However, another possibility is to use tomcat as a dispatcher / proxy for other applications in different cats or in the same one.
For this, you are advised to use UrlRewriteFilter
Create a new web project called ROOT, integrate UrlRewriteFilter and deploy it to your tomcat. (Download the commons-codec and commons-httpclient libraries if you intend to use it as a proxy)
Edit urlrewrite.xml and create your own routing there.
<rule> <condition name="host" operator="equal">mydomain1.com</condition> <from>(.*)</from> <to type="proxy">http://localhost:8080/MyDomain1/index.jsp?$1</to> </rule> <rule> <condition name="host" operator="equal">mydomain2.com</condition> <from>(.*)</from> <to type="proxy">http://localhost:8090/MyDomain2/index.jsp?$1</to> </rule>
* Remember to "enter" according to your needs in more detail .
* This filter is very useful for creating friendly URLs for SEO.
source share