Hi,
You might want to revisit a few key elements of the Deployment
Descriptor as explained in the Servlet Specification.  These include:
- The use of welcome-file to serve the resource /.  You typically do NOT
want to define a servlet at url-pattern /.
- url-pattern does not include the docBase, but rather it's relative to
the docBase.  So for http://yourhost/yourwebsite/Login, the url-pattern
is just /Login.

Read the Servlet Specification, it answers your questions completely and
in detail.  That's what it's for.

Yoav Shapira
Millennium Research Informatics


>-----Original Message-----
>From: Jon Doe [mailto:[EMAIL PROTECTED]
>Sent: Friday, July 23, 2004 4:11 PM
>To: [EMAIL PROTECTED]
>Subject: How does the deploy descriptor work?
>
>I thought I understood this, but clearly I don't! (Or at least my app
>doesn't work.) So, if I may, I would like to explain my understanding
of
>how
>you create the deploy descriptor, and how it works in Tomcat. Just to
get
>some clarity.
>
>OK, so I have a website, hosted as the context /mywebsite in Tomcat. So
the
>localhost syntax to the root of this application is:
>
>       http://localhost/mywebsite/
>
>Now as I understand it, to get this URL to execute a servlet called
Index
>(ie the class WEB-INF\classes\com\mywebsite\Index.class -- assumes
Windows)
>I need to add this to the deployment descriptor:
>
>       <servlet>
>               <servlet-namemyRoot</servlet-name>
>               <servlet-class>com.mywebsite.Index</servlet-class>
>       </servlet>
>       <servlet-mapping>
>               <servlet-namemyRoot</servlet-name>
>               <url-pattern>/</url-pattern>
>       </servlet-mapping>
>
>That is straight forward. Now what if I want /Login, /Register,
/Catalogue,
>etc? What is the url-pattern for these? If I enter /Login, for example,
>will
>this the call that servlet when I use this URL:
>
>       http://localhost/mywebsite/Login
>
>If not, and I have to use a url-pattern of /mywebsite/Login, what
happens
>if
>I decide to change the context path, or even to host it as a virtual
>server?
>Do I have to re-edit the web.xml file to reflect these changes?
>
>One final question. If the url-pattern for Login is
>/mywebsite/Login.something, does this mean the user has to type:
>
>       http://localhost/mywebsite/Login.something
>
>for this to trigger? In short, is it the URL that is all important, and
not
>the underlying filenames? (God knows how the wildcards work, so I've
been
>trying to use 'full paths' as I thought this was easier. But I get no
>output
>even though I have lines writing to the ServletConfig log, to standard
out
>and to the PrintWriter output!)
>
>If anyone can comment on the above -- such as it is totally accurate,
or it
>is all rubbish -- that would be useful!
>
>Joe.
>
>_________________________________________________________________
>STOP MORE SPAM with the new MSN 8 and get 2 months FREE*
>http://join.msn.com/?page=features/junkmail
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to