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

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>
主站蜘蛛池模板: 曲阳县| 巫山县| 鄂托克前旗| 磐石市| 桂平市| 徐水县| 同仁县| 郑州市| 育儿| 黄山市| 张家界市| 西贡区| 柳江县| 石屏县| 永德县| 彩票| 友谊县| 连云港市| 莱阳市| 高碑店市| 兴国县| 林甸县| 泾川县| 田东县| 太湖县| 彭阳县| 宁德市| 新津县| 南华县| 梁河县| 鄯善县| 临城县| 青阳县| 重庆市| 谢通门县| 广元市| 安乡县| 吉隆县| 象山县| 定日县| 镇坪县|