forked from macrozheng/mall
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zhh
committed
Aug 6, 2018
1 parent
575eb0a
commit 69ec434
Showing
4 changed files
with
33 additions
and
5 deletions.
There are no files selected for viewing
Binary file not shown.
21 changes: 21 additions & 0 deletions
21
mall-portal/src/main/java/com/macro/mall/portal/MallPortalApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,35 @@ | ||
package com.macro.mall.portal; | ||
|
||
import org.apache.catalina.connector.Connector; | ||
import org.mybatis.spring.annotation.MapperScan; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.boot.context.embedded.EmbeddedServletContainerFactory; | ||
import org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory; | ||
import org.springframework.context.annotation.Bean; | ||
|
||
@SpringBootApplication | ||
@MapperScan({"com.macro.mall.mapper","com.macro.mall.portal.dao"}) | ||
public class MallPortalApplication { | ||
@Value("${http.port}") | ||
private Integer port; | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(MallPortalApplication.class, args); | ||
} | ||
|
||
@Bean | ||
public EmbeddedServletContainerFactory servletContainer() { | ||
TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory(); | ||
tomcat.addAdditionalTomcatConnectors(createStandardConnector()); // 添加http | ||
return tomcat; | ||
} | ||
|
||
//配置http | ||
private Connector createStandardConnector() { | ||
Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol"); | ||
connector.setPort(port); | ||
return connector; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters