jhipster 使用什么服务器?
What server does jhipster use?
我知道您可以构建一个 WAR 文件来部署到应用程序服务器,但是当您 运行 主应用程序 class 时会创建什么样的服务器?
/**
* 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"));
}
默认情况下 Spring 引导使用 Tomcat。您可以将其配置为使用 Jetty or Undertow 作为嵌入式容器。您可以检查您的 pom.xml
并查看是否有任何对它们的引用。如果不是,您可以假设,它是 Tomcat
JHipster 3.7.0 版本后迁移到Undertow。发行说明说:
Migration to Undertow is our biggest change - see #4054. This brings some very good performance enhancements in start up time and memory usage: this is good for everyone, but people doing microservices will benefit from it even more. With this change, JHipster uses nearly as much JBoss code (Undertow, Hibernate, Bean Validation, MapStruct) as Spring code!
有关详细信息,请访问 here
我知道您可以构建一个 WAR 文件来部署到应用程序服务器,但是当您 运行 主应用程序 class 时会创建什么样的服务器?
/**
* 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"));
}
默认情况下 Spring 引导使用 Tomcat。您可以将其配置为使用 Jetty or Undertow 作为嵌入式容器。您可以检查您的 pom.xml
并查看是否有任何对它们的引用。如果不是,您可以假设,它是 Tomcat
JHipster 3.7.0 版本后迁移到Undertow。发行说明说:
Migration to Undertow is our biggest change - see #4054. This brings some very good performance enhancements in start up time and memory usage: this is good for everyone, but people doing microservices will benefit from it even more. With this change, JHipster uses nearly as much JBoss code (Undertow, Hibernate, Bean Validation, MapStruct) as Spring code!
有关详细信息,请访问 here