Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure multiple servletcontainers/servlets with spring boot

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

Does anyone know how to achieve this?

like image 662
Peter Bartels Avatar asked Feb 07 '14 14:02

Peter Bartels


1 Answers

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.

like image 120
Dave Syer Avatar answered Sep 20 '22 00:09

Dave Syer