Here is what you need to do to have your own folders. Let's say you want to create a 
folder 'abraham'. Open up Win Explorer create 'abraham' under c:\tomcat\webapps

Remember all new app directories you create should go under c:\tomcat\webapps
( not 100 % sure :) but will get you going ! )

Change to the new directory abraham

1. Under abraham , create WEB-INF
2. Under WEB-INF create another directory classes


So now you have C:\tomcat\webapps\abraham\WEB-INF
and          C:\tomcat\webapps\abraham\WEB-INF\classes

Copy web.xml available at C:\tomcat\webapps\ROOT\WEB-INF to
C:\tomcat\webapps\abraham\WEB-INF

Copy your static HTML pages, GIFs etc  to C:\tomcat\webapps\abraham
Your Servlet classes goes to C:\tomcat\webapps\abraham\WEB-INF\classes

Now to the most important step..

I assume by now you know the significance of SERVER.XML in Tomcat. If not
read about it in  documentation .

This file is available at c:\tomcat\conf. Make a copy of this file before you edit it.
Inside this file there will be a 'Context' tag. as shown below

<Context path="/examples" docBase="webapps/examples" crossContext="false" debug="0" 
reloadable="true" />

Make a copy of this line and on the copy change it to

<Context path="/abraham" docBase="webapps/abraham" crossContext="false" debug="0" 
reloadable="true" />

Save the file and stop and restart tomcat

When you access the Servlet the URL should be

http://localhost:8080/abraham/servlet/Serv01

When you redirect to another servlet from Serv01

response.sendRedirect("/abraham/servlet/Serv02")

To another static HTML Page

response.sendRedirect("/abraham/test01.html");

You could have other subdirectories under 'abraham' let's say 'images'
if you want to access a gif from this directory, you should code it as

<IMG SRC='/abraham/images/pic01.gif'>

Good Luck !

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to