tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (Kedar Choudary)
Subject Re: web.xml question
Date Wed, 06 Dec 2000 05:18:34 GMT

You dont *have* to register any servlet in web.xml.
Registering servlet in web.xml is only required if you want to access the
servlet by a "nickname".
Typically one creates a nickname for his servlet in web.xml to
1) Hide the actual implementation class name being exposed to the world in
the URL
2) To create short name, espicially to drop that long list of package

But you can verywell access any servlet, that is present in WEB-INF/classes
directory, by URL /yourcontext/servlet/package.prefix.classname.

Regarding the second question, unfortunately, there seems to be no way to
specify a servelt, in place of a "welcome-file". So, I guess, easiest way to
setup your servlet as welcome-file, will be to have a index.jsp in your
context's root directory which simply forwards the request to your servlet,
using jsp:forward.

Kedar Choudhary.

----- Original Message -----
From: Vanja Vlaski <>
To: <>
Sent: Tuesday, December 05, 2000 3:58 PM
Subject: web.xml question

> Since I am new to the tomcat I have one probably stupid question.Do I have
> to register all the servlets I use in web.xml or just the first servlet
> is called?
> Also how can I call the servlet at the beging instead of index.html?
> Thanks
> Get more from the Web.  FREE MSN Explorer download :

View raw message