首先,boot项目默认起来的容器为tomcat,因此在新建的boot项目中缺乏了spring-boot-starter-web这个依赖,它表示项目支持boot内置tomcat启动 spring-boot-starter-web默认使用嵌套式的Tomcat做为Web容器对外提供HTTP服务,默认端口8080对外监听和提供服务 咱们一样可使用spring-boot-starter-jetty或者spring-boot-starter-undertow做为Web容器。 想改变默认的配置端口,能够在application.properties中指定:web
server.port = 9000(the port number you want)
maven依赖:spring
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-jdbc</artifactId> </dependency>
AOP:Aspect Oriented Programming,面向切面编程编程
1.位于spring-boot-autoconfigure的org.sringframework.boot.autoconfigure.aop.AopAutoConfiguration提供的@Configuration配置类和相应的配置项,即下面的2个配置项:tomcat
spring.aop.auto=true spring.aop.proxy-target-class=false
2.spring-boot-starter-aop模块提供了针对spring-aop aspectjrt 和aspectjweaver的依赖安全
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-security</artifactId> </dependency>