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

An embedded web server

Spring Boot, by default, provides Apache Tomcat as an embedded application container. This book will use the Jetty-embedded application container in 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 situation may change after this book has been written.

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

<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>
主站蜘蛛池模板: 交口县| 饶平县| 万源市| 巍山| 民乐县| 木兰县| 大邑县| 景谷| 邯郸县| 德清县| 紫金县| 宁陵县| 老河口市| 临清市| 沂水县| 神木县| 太谷县| 嘉兴市| 东丰县| 房山区| 泰州市| 宜章县| 平原县| 离岛区| 南郑县| 淮南市| 金沙县| 信阳市| 东莞市| 海盐县| 正定县| 沾益县| 曲靖市| 永嘉县| 玉屏| 攀枝花市| 南康市| 乌兰县| 开封市| 麻江县| 方山县|