使用Spring Boot配置多个servletcontainer/servlet [英] Configure multiple servletcontainers/servlets with spring boot

查看:316
本文介绍了使用Spring Boot配置多个servletcontainer/servlet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Spring Boot在不同端口上加载两个具有嵌入式tomcat配置的servlet容器.

I want to load two servlet containers with embedded tomcat configuration on different ports with Spring Boot.

有人知道如何实现这一目标吗?

Does anyone know how to achieve this?

推荐答案

它应该很简单:只需根据需要创建尽可能多的EmbeddedWebApplicationContext类型的ApplicationContexts,并为它们分别提供一个具有不同端口的EmbeddedServletContainerFactory.示例

It should be simple: just create as many ApplicationContexts of type EmbeddedWebApplicationContext as you need and give them each an EmbeddedServletContainerFactory with a different port. Example here where the two contexts are parent and child, but that's not a necessary part of the setup.

这篇关于使用Spring Boot配置多个servletcontainer/servlet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆