1

I need to convert an old web application containing multiple tomcat contexts into a Spring Boot application that utilizes Embedded Tomcat.

The following is the server.xml file defining the contexts:

server.xml

Is there a way in which I can configure a Spring Boot application in order for it to contain all of these contexts?

I've seen that it's possible to configure a context by overriding methods of the TomcatServletWebServerFactory, is there any method of that class I can override to define more than one context?

Clifford
  • 88,407
  • 13
  • 85
  • 165
  • 1
    Those are 4 different application not a single one. So just create 4 different apps. – M. Deinum Dec 07 '22 at 14:19
  • I think I haven't explained myself properly, let me clarify: Currently a single application contains the code related to all of the different Tomcat contexts, so turning this single monolith into 4 separate applications would be extremely complex. Is this actually the only solution? – Federico Favaro Dec 09 '22 at 08:10
  • That isn't what this configuration you have is showing. It shows mapping to 4 different directories for 4 different applications. If it is 1 application, why extract it 4 times to begin with? – M. Deinum Dec 09 '22 at 08:20
  • The webapp directories are different for all 4 applications, but the SRC folder is having all the Java files associated with all 4 applications. We can't bifurcate the src folder as the code is very old and not that systematic – Federico Favaro Dec 09 '22 at 09:29
  • You can create 4 directories, so why wouldn't you be able to do the same for 4 applications? You apaprently already have a process inplace to do the directories. I would also suspect (but I don't know your app) that the main difference is configuration. – M. Deinum Dec 09 '22 at 09:57

0 Answers0