jhipster使用什么服务器?

时间:2015-11-17 16:48:00

标签: java spring-boot jhipster servlet-container

我知道您可以构建一个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"));
}

2 个答案:

答案 0 :(得分:6)

默认情况下,Spring Boot使用Tomcat。您可以将其配置为使用Jetty or Undertow作为嵌入式容器。您可以查看pom.xml并查看是否有任何引用。如果没有,你可以假设,它是Tomcat

答案 1 :(得分:2)

从3.7.0版开始,JHipster迁移到 Undertow 。发行说明说:

  

迁移到Undertow 是我们最大的更改-请参见#4054。这在启动时间和内存使用方面带来了一些非常出色的性能增强:这对每个人都有好处,但是使用微服务的人会从中受益更多。有了这一更改,JHipster使用的JBoss代码(Undertow,Hibernate,Bean验证,MapStruct)几乎与Spring代码一样!

有关更多信息,请访问here