java面试遇到的问题(springboot)

1.springboot内置了哪些容器?

默认tomcat,还有undertow以及jetty。

2.如何替换默认容器?

主要是修改pom文件的依赖。


    org.springframework.boot
    spring-boot-starter-web
    
    
        
            org.springframework.boot
            spring-boot-starter-tomcat
        
    

    

    org.springframework.boot
    spring-boot-starter-undertow




   org.springframework.boot
   spring-boot-starter-web
 
   
      
         org.springframework.boot
         spring-boot-starter-tomcat
      
   


   org.springframework.boot
   spring-boot-starter-jetty

3.springboot的核心注解,它包含了哪些注解?

启动类要加@springbootApplication,这个注解包含了@Configuration、@EnableAutoConfiguration、@ComponentScan三个注解。

你可能感兴趣的:(2019年java面试)