|
@@ -17,8 +17,8 @@ import org.springframework.scheduling.annotation.EnableScheduling;
|
|
@MapperScan({"com.example.nngkxxdp.dao", "com.example.nngkxxdp.program.dao"})
|
|
@MapperScan({"com.example.nngkxxdp.dao", "com.example.nngkxxdp.program.dao"})
|
|
public class NngkxxdpApplication {
|
|
public class NngkxxdpApplication {
|
|
//
|
|
//
|
|
-// @Value("${http.port}")
|
|
|
|
-// private Integer port;
|
|
|
|
|
|
+ @Value("${http.port}")
|
|
|
|
+ private Integer port;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -27,16 +27,16 @@ public class NngkxxdpApplication {
|
|
}
|
|
}
|
|
|
|
|
|
// 前面基本一致,只不过注入了一个http端口,主要改下面
|
|
// 前面基本一致,只不过注入了一个http端口,主要改下面
|
|
-// @Bean
|
|
|
|
-// public ServletWebServerFactory servletContainer() {
|
|
|
|
-// TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
|
|
|
|
-// tomcat.addAdditionalTomcatConnectors(createStandardConnector()); // 添加http
|
|
|
|
-// return tomcat;
|
|
|
|
-// }
|
|
|
|
-// // 配置http
|
|
|
|
-// private Connector createStandardConnector() {
|
|
|
|
-// Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
|
|
|
|
-// connector.setPort(port);
|
|
|
|
-// return connector;
|
|
|
|
-// }
|
|
|
|
|
|
+ @Bean
|
|
|
|
+ public ServletWebServerFactory servletContainer() {
|
|
|
|
+ TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory();
|
|
|
|
+ tomcat.addAdditionalTomcatConnectors(createStandardConnector()); // 添加http
|
|
|
|
+ return tomcat;
|
|
|
|
+ }
|
|
|
|
+ // 配置http
|
|
|
|
+ private Connector createStandardConnector() {
|
|
|
|
+ Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol");
|
|
|
|
+ connector.setPort(port);
|
|
|
|
+ return connector;
|
|
|
|
+ }
|
|
}
|
|
}
|