boot相关依赖详解

快速web应用开发与spring-boot-starter-web

首先,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)

数据访问与spring-boot-starter-jdbc

maven依赖:spring

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>

spring-boot-starter-aop应用及其使用场景

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的依赖安全

应用安全与spring-boot-starter-security

<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>
相关文章
相关标签/搜索