You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Vanja Vlaski <vo...@hotmail.com> on 2000/12/05 11:28:33 UTC

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 that 
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 : http://explorer.msn.com


Re: web.xml question

Posted by Catherine Jung <ca...@netcentricsystems.net>.
On Wed, 6 Dec 2000, Kedar Choudary wrote:

> 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.

Can't you use a servlet as a <welcome-file> in your <welcome-file-list>
tag in web.xml then? I've never done it myself, but I've also not read
anything that says you can't.

Catherine

> 
> Kedar Choudhary.
> 
> ----- Original Message -----
> From: Vanja Vlaski <vo...@hotmail.com>
> To: <to...@jakarta.apache.org>
> 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
> that
> > 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 :
> http://explorer.msn.com
> >
> >
> 
> 


Re: web.xml question

Posted by Kedar Choudary <ke...@cysphere.com>.
Hi,

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
prefixes.

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 <vo...@hotmail.com>
To: <to...@jakarta.apache.org>
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
that
> 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 :
http://explorer.msn.com
>
>