jhipster使用什么服务器?

uyl*_*lmz 2 java servlet-container spring-boot jhipster

我知道您可以构建一个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"));
}
Run Code Online (Sandbox Code Playgroud)

jny*_*jny 6

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

  • 而我(JHipster的作者)证实它是Tomcat. (2认同)

Spa*_*ara 5

3.7.0 版本后 JHipster 迁移到Undertow。发行说明中写道:

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

欲了解更多信息,请访问此处