我想用Spring Boot在不同的端口上加载两个带有嵌入式tomcat配置的servlet容器 .
有谁知道如何实现这一目标?
它应该很简单:只需根据需要创建 EmbeddedWebApplicationContext 类型的 ApplicationContexts ,并为每个 EmbeddedServletContainerFactory 提供一个不同的端口 . 示例here其中两个上下文是父级和子级,但这不是设置的必要部分 .
EmbeddedWebApplicationContext
ApplicationContexts
EmbeddedServletContainerFactory
1 回答
它应该很简单:只需根据需要创建
EmbeddedWebApplicationContext
类型的ApplicationContexts
,并为每个EmbeddedServletContainerFactory
提供一个不同的端口 . 示例here其中两个上下文是父级和子级,但这不是设置的必要部分 .