我知道您可以构建一个WAR文件来部署到应用程序服务器,但是在运行主Application类时会创建什么样的服务器?
/**
* Main method, used to run the application.
*/
public static void main(String[] args) throws UnknownHostException {
SpringApplication app = new SpringApplication(Application.class);
SimpleCommandLinePropertySource source = new SimpleCommandLinePropertySource(args);
addDefaultProfile(app, source);
Environment env = app.run(args).getEnvironment();
log.info("Access URLs:\n-----------------------------------------------------\n\t" +
"Local: \t\thttp://127.0.0.1:{}\n\t" +
"External: \thttp://{}:{}\n-----------------------------------------------",
env.getProperty("server.port"),
InetAddress.getLocalHost().getHostAddress(),
env.getProperty("server.port"));
}
答案 0 :(得分:6)
默认情况下,Spring Boot使用Tomcat。您可以将其配置为使用Jetty or Undertow作为嵌入式容器。您可以查看pom.xml
并查看是否有任何引用。如果没有,你可以假设,它是Tomcat
答案 1 :(得分:2)