35. 在Spring Boot中配置web app
添加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>配置端口
server.port=8083server:
port: 8083@Component
public class CustomizationBean implements
WebServerFactoryCustomizer<ConfigurableServletWebServerFactory> {
@Override
public void customize(ConfigurableServletWebServerFactory container) {
container.setPort(8083);
}
}配置Context Path
配置错误页面
在程序中停止Spring Boot
配置日志级别
注册Servlet
切换嵌套服务器
最后更新于
这有帮助吗?