This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Tomcat and the fly likes URL path Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "URL path" Watch "URL path" New topic

URL path

loni silverstein

Joined: Jun 20, 2003
Posts: 14
I see that the common url path for accessing the servlet is http://myserver/myapps/servlet/myservlet. Can one put the myapps under another level of directory, let say x (so the servlet is physically located in c:\\Tomcat\webapps\x\myapps\WEB-INF\classes) so that the url becomes http://myserver/x/myapps/servlet/myservlet? what file (server.xml, web.xml?), if any, does one have to modify to accomplish this? Thank you
Nimchi Yung
Ranch Hand

Joined: Jan 27, 2004
Posts: 71
Try this:
add this entry to your %CATALINA_HOME%/conf/server.xml
<Context path="/x/myapps" docBase="x/myapps" debug="0"
reloadable="true" crossContext="false"/>
It is sorta covered in the JavaRanch Style Guide.
subject: URL path
Similar Threads
first job of servlet container
keeping the directory path hidden
Disable Directory Listing
HTTP Status 404 - /myapps/helloworldservlet
Finding a servlet's actual path