简体   繁体   English

我是否正在使用Tomcat Web服务器?

[英]Am i using the Tomcat webserver or not?

so i'm making this application in Spring Boot and i know by default, spring boot is embedded to tomcat web server. 因此,我在Spring Boot中制作此应用程序,并且我知道默认情况下,Spring Boot嵌入到tomcat Web服务器中。 But i'm not sure whether it's tomcat web server or else because in my dependency there is no tomcat dependency in my code. 但是我不确定是tomcat Web服务器还是其他,因为在我的依赖项中,我的代码中没有tomcat依赖项。 but i access the webserver succesfully through 但是我通过成功访问了Web服务器

localhost:8080

and here is my dependency 这是我的依赖

<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
 </dependency>
 <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>
 </dependency>
 <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <optional>true</optional>
 </dependency>

so am i using the tomcat server or not? 所以我在用tomcat服务器吗?

You're using embedded tomcat by default as spring-boot-starter-web has a dependency on tomcat libraries which are transitive. 您默认使用嵌入式tomcat,因为spring-boot-starter-web依赖于可传递的tomcat库。

To be more precise, spring-boot-starter-web among other things has the following definition in its pom.xml: 更确切地说,spring-boot-starter-web在其pom.xml中具有以下定义:

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

Check your logs, please, or console messages, 请检查您的日志或控制台消息,

Spring Boot prints this Spring Boot打印此

2018-09-25 00:45:24 INFO   TomcatWebServer 91: Tomcat initialized with port(s): 8080 (http) 

spring-boot-starter-web comes with Embedded Tomcat. spring-boot-starter-web随附于嵌入式Tomcat。 In case you want to edit the 如果您要编辑

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

It has the below properties :
server:
port:
undertow:
ioThreads:
workerThreads:
accesslog:
enabled:
compression:
enabled:
mimeTypes:
minResponseSize:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM