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

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>
主站蜘蛛池模板: 绩溪县| 安徽省| 上饶县| 行唐县| 和硕县| 武清区| 本溪市| 黄大仙区| 淳安县| 昆明市| 谷城县| 太仓市| 南华县| 屏南县| 邯郸市| 蒲城县| 伊金霍洛旗| 辉南县| 岳阳县| 东方市| 循化| 元阳县| 托克逊县| 甘德县| 岐山县| 石嘴山市| 海宁市| 松滋市| 富顺县| 长丰县| 洮南市| 乌审旗| 满洲里市| 五莲县| 开江县| 庆城县| 盐津县| 荆门市| 祥云县| 县级市| 城口县|