Hi,
You need to have ${TOMCAT_HOME}/webapps/pr for your webapp
then you need a subdirectory called WEB-INF with a file called web.xml in it
with the following blank content:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
</web-app>
then you need a further subdirectory in WEB-INF called classes this is where you should
put your classes.
Then you should restart tomcat and then be able to access it through
http://localhost:8080/pr/servlet/yourFullyQualifiedClassName
Regards
Peter
-----Original Message-----
From: Sohaila Roberts [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 13, 2002 4:21 PM
To: [EMAIL PROTECTED]
Subject: getting a servlet to work with tomcat
Hi, i've successfully installed tomcat on redhat 7.2, and running the
examples works perfect by going to
http://localhost:8000/examples/servlets/index.html
but when i tried to run one of my own servlets it didnt work.
I created/compiled my servlet, SampleServlet, put it in a dir
tomcat/webapps/pr/ made a war file pr.war (by doing jar cvf pr.war pr/
from the webapps dir) and let the war file in the webapps dir. I restarted
tomcat and it said
2002-08-13 12:31:21 - ContextManager: Adding DEFAULT:/pr
so i ran my page which calls the servlet and when it tried to run the
servlet i got this from tomcat:
2002-08-13 12:40:23 - Ctx(/pr) : Status code:404 request:R( /pr +
/SampleServlet + null) msg:null
i dont have all the directory's (images jsp META-INF servlets WEB-INF)
like their examples dir has, my pr directory only has the
SampleServlet.class and SampleServlet.java in it..
what am I doing wrong? do i have to have the meta-inf & all those dirs in
there too? of so, how do i do that and why do ihave to do that?
Thanks,
Sohaila
___________________________________________________________________________
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
___________________________________________________________________________
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