官术网_书友最值得收藏!

Adding a Jetty-embedded server

Spring Boot by default provides Apache Tomcat as an embedded application container. This book will use the Jetty-embedded application container in the place of Apache Tomcat. Therefore, we need to add a Jetty application container dependency to support the Jetty web server.

Jetty also allows you to read keys or trust stores using classpaths, that is, you don't need to keep these stores outside the JAR files. If you use Tomcat with SSL then you will need to access the key store or trust store directly from the filesystem, but you can't do that using the classpath. The result is that you can't read a key store or a trust store within a JAR file because Tomcat requires that the key store (and trust store if you're using one) is directly accessible on the filesystem. This may change post writing of this book.

This limitation doesn't apply to Jetty, which allows the reading of keys or trust stores within a JAR file. A relative section on pom.xml of module rest:

<dependencies> 
<dependency> 
       <groupId>org.springframework.boot</groupId> 
           <artifactId>spring-boot-starter-web</artifactId> 
           <exclusions> 
             <exclusion> 
<groupId>org.springframework.boot</groupId> 
<artifactId>spring-boot-starter-tomcat</artifactId> 
                </exclusion> 
            </exclusions> 
</dependency> 
<dependency> 
<groupId>org.springframework.boot</groupId> 
<artifactId>spring-boot-starter-jetty</artifactId> 
</dependency> 
</dependencies>
主站蜘蛛池模板: 伊金霍洛旗| 齐河县| 平乡县| 桐乡市| SHOW| 革吉县| 扎赉特旗| 米脂县| 龙泉市| 靖州| 阿鲁科尔沁旗| 无为县| 祥云县| 虞城县| 江孜县| 鄯善县| 延川县| 南木林县| 杭州市| 曲阜市| 德惠市| 赣榆县| 栾川县| 澄城县| 漳州市| 兴和县| 双城市| 万州区| 肇东市| 青川县| 孝感市| 镇安县| 甘德县| 昆明市| 甘肃省| 双流县| 资源县| 英山县| 沅陵县| 马公市| 沁阳市|