Can I configure Tomcat so that the name of the webapp is not used in the URL? E.g. http://localhost/servlet/HelloWorld, instead of http://localhost/examples/servlet/HelloWorld.

Simon Brown

You can ... but I'm not sure I'd do this on a live system!

The path you give a context must be unique within the server.xml document. Therefore, all you need to do is change the path of the ROOT webapp (to "/root" for example) and change the path of your webapp to an empty string as below.

<Context path="" docBase="webapps/examples" debug="0" reloadable="true" > 
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact