OK, I am working on creating a web.xml file.  I started out by looking at 
the web.xml that will be found in $CATALINA_HOME/webapps/WEB-INF.  I wanted 
to see what was in it that allowed the HelloWorldExample to work.  Nowhere 
in the web.xml was there a reference to this servlet.  As a matter of fact, 
the only servlets listed were ones that were in subdirectories below the 
/WEB-INF/classes subdirectory.  Which would leave me to believe that as long 
as I have my classes in /WEB-INF/classes, I should be able to run this 
servlet even with a blank web.xml.  Am I wrong here?  Am I missing 
something?
Thanks


----Original Message Follows----
From: Walter De Wit <[EMAIL PROTECTED]>
Reply-To: "Tomcat Users List" <[EMAIL PROTECTED]>
To: 'Tomcat Users List' <[EMAIL PROTECTED]>
Subject: RE: Just trying to make some sense out of all this tomcat(newbie)
Date: Thu, 17 Jan 2002 12:40:13 +0100

I can give you the same answer as I gave to an our or two before:

I think you forgot the web.xml file which contains the mapping between the
URL and the servlet class file.
In web.xml which must be situated in WEB-INF directory, for each servlet
there must be a servlet-mapping entry:
<servlet>
   <servlet-name>MyServlet</servlet-name>

<servlet-class>subdirectory1.subdirectory2.subdirectory3.servlet1.class</ser
vlet-class>
</servlet>
<servlet-mapping>
   <servlet-name>MyServlet</servlet-name>
   <url-pattern>/pathie/doMyServlet</url-pattern>
</servlet-mapping>

Now calling http://localhost:8080/MyWebapp/pathie/doMyServlet will start the
servlet1.class.
The servlet1.class must be situated in
WEB-INF/classes/subdirectory1/subdirectory2/subdirectory3/ or in a jar in
the WEB-INF/lib directory.

Maybe you should read some documentation about a .war file (which is a
.jar), or open one of the examples delivered together with Tomcat.


-----Original Message-----
From: Donald Lee [mailto:[EMAIL PROTECTED]]
Sent: donderdag 17 januari 2002 12:27
To: [EMAIL PROTECTED]
Subject: Just trying to make some sense out of all this tomcat(newbie)


Ok, if anybody can explain in plain english why this is the way it is.
while trying to download and install a servlet and being very unsuccessful,
I started investigating the example servlets.  I went to the simplest one
called HelloWorldExample.
It appears to be working, when I look in the browser address it's set to
http://lnxwebsvr:8080/examples/servlet/HelloWorldExample.
when I look at my directory structure.
/var/tomcat4/webapps/examples/WEB-INF/classes/HelloWorldExample.class
where is it defined in tomcat that "servlet" is to replace the actual path
"WEB-INF/classes"?
I think this may be related to why my newly installed servlet will not run.
Thanks


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>




_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

Reply via email to