Hello,
I have installed Tomcat 5.0.25 . I am trying to create a web application,
but having trouble deploying servlets.
I have created the required directory structure in the TOMCAT_HOME/webapps
directory...namely examples/WEB-INF/classes.
Also I added
<Context path="/examples" docBase="examples" debug="0"
reloadable="true"></Context>
within the 'host' element of the server.xml file.
To test I placed a simple html file in the TOMCAT_HOME/webapps/examples
directory, and that worked fine.
Now, to test servlets, I placed a simple HelloWorld servlet class file in
the TOMCAT_HOME/webapps/examples /WEB-INF/classes directory. I also shutdown
adn restarted the server, but teh servlet doesnt work when I point my
browser to
http://localhost:8080/examples/servlet/HelloWorld.
I get following message:
The requested resource (/examples/servlet/HelloWorld) is not available.
I have read about adding a <servlet> element to the web.xml file in WEB-INF
directory. I did that too. But that didnt help. The web.xml file I have in
/examples/WEB-INF/ now looks las follows:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!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>
I remember in a previous installation of Tomcat (someone else and installed
it) I had a webapplication directory, similar to the 'examples' directory
above, and could place my class files in the classes directory, without
adding any entry into the web.xml file, and the servlets would work fine .
Can anyone see what I have done wrong..why wont my servlets work?
Thanks in advance,
Swapna
_________________________________________________________________
Post Classifieds on MSN classifieds. http://go.msnserver.com/IN/44045.asp
Buy and Sell on MSN Classifieds.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)