tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendy Smoak <>
Subject RE: I need help about deploying a servlet in tomcat
Date Wed, 30 Jun 2004 22:43:44 GMT
> From: Brian SJ Wong [] 

> I am going to use the ROOT 
> folder to store my servlets. There is a web.xml file in that 
> folder and I only alter the information about the servlet 
> that I am going to put, which is the HelloWorld. I only wrote 
> the and put them in the 
> ../ROOT/WEB-INF/classes folder.

The Java source code does not go in ROOT/WEB-INF/classes.  That's where
the compiled code goes.  

> I was hoping that when I invoke the
http://localhost:8081/servlet/HelloWorld, it will 
> automatically compile the and make the class. 

AFAIK, Tomcat will not automatically compile your Servlets.  So, first
thing, compile your file into HelloWorld.class.  Your
previous comments indicate that you know how to do that.  If not, post
the commands you're typing and the exact error message you're getting,
and someone will help.

Even when you get that done, the URL you intend to use will NOT work.
URLs with /servlet in them generally depend on the Invoker Servlet being
enabled.  The Invoker Servlet is disabled by default.  So drop the
/servlet part of the URL, and edit web.xml to include <servlet> and
<servlet-mapping> tags for your Servlet.

Here's the example web.xml file from the Tomcat 5 docs:

Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message