Click Upvote Click Upvote - 10 months ago 42
Java Question

How to get Netbeans to deploy Java web app to Tomcat's Root (e.g /) instead of /MyProject?

Netbeans always deploys the .war of my application to /MyProject on Tomcat. This means that I view them on

, and all links such as
don't work as they point to
rather than
. How can I get Netbeans to instead deploy the application to the root of Tomcat?

Answer Source

That should be in your context.xml. The details of the configuration are here Moreover, the context.xml is accessible within the /META-INF/context.xml path. I don't think that NetBeans will do that for you. We have to specify that ourselves, just like in GlassFish where I had to do the same thing in a glassfish-web.xml file.