[英]configure embedded tomcat context docBase and path in spring boot gradle
[英]Embedded tomcat container is not taking the context path from application properties.(Spring boot)
我正在为我的Web应用程序使用spring boot。 我在应用属性中为myApplication
设置了上下文路径。 但是,当我运行我的应用程序时,嵌入式容器未设置上下文路径。
application.properties
server.context-path=/myApplication
oaccC[Tomcat].[localhost].[/](Here the context is missing)
:初始化Spring嵌入式WebApplicationContext(运行容器时的日志)
这可能是什么原因?
尝试将其添加到您的配置中
@Component
public class CustomizationBean implements EmbeddedServletContainerCustomizer {
@Override
public void customize(ConfigurableEmbeddedServletContainer container)
{
container.setPort(8083);
}
}
http://docs.spring.io/spring-boot/docs/current/reference/html/howto-embedded-servlet-containers.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.