At work we have many Spring apps running on one tomcat server. Some of the apps have their own domains with a virtualhost in apache that rewrites requests from /url to /context_root/url.
This is all fine and good except for when I use some of springs tag libs that handle urls. An example is the <form:form> tag which creates an action of /context_root/form and takes the user away from /. Now, the app still works when that happens but management doesn’t want to see the context root.
What is the best way to tackle this?
In case anyone stumbles into this, I did end up finding the answer.
With Tomcat you can have multiple hosts. So I setup a host with my app as the default webapp. Here’s an example:
Add another Host to server.xml
Create some files and directories
If you want the Tomcat manager for this host
Then restart tomcat and you’re good. Deploy the lilhug app to
/using the/managerrunning at your new host or copy the war to$CATALINA_HOME/lilhug/ROOT.war