tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefán F. Stefánsson <>
Subject RE: webapp icons, disabling directory listings, and <error-page> tags in web.xml
Date Tue, 27 Feb 2001 13:19:29 GMT
Thanks for your reply.

Only problem is (and I forgot to mention this) that I'm using an
embedded Tomcat and hence have no server.xml file.  Maybe I can do
something in the code to handle this... I'll have to look into that.

What you said about server.xml not being the right place to define
servlet or JSP traps I didn't quite get because I was talking about
web.xml not server.xml. Thanks though.  Anyone else?

Kind regards,

-----Original Message-----
From: Chris Haynes []
Sent: 27. febrúar 2001 12:56
Subject: Re: webapp icons, disabling directory listings, and
<error-page> tags in web.xml


You can turn off the generation of indexes by setting the argument
in the StaticInterceptor entry in server.xml.

For error handling in the servlets look at JSP:
<%@ page isErrorpage="true"> flags the page as an error handler
<%@ page errorPage="errorHandler.jsp"> tells a page where its error
handler is.

    If you are writing your own servlets, I recommend having a
   }catch(Exception e) { ... }
immediately inside your doGet() method to trap all exceptions and do
something sensible.
server.xml is not where I would define servlet or JSP traps.

Can't help with the rest.


----- Original Message -----
From: "Stefán F. Stefánsson" <>
To: "Tomcat-User" <>
Cc: "JSP-Interest" <>
Sent: Tuesday, February 27, 2001 12:40 PM
Subject: webapp icons, disabling directory listings, and <error-page>
tags in web.xml


I was wondering if anyone knows if the <icon> element in web.xml is
working in Tomcat (it's not working for me... just wondering if it's
supported or if it's something specific with me).

Another thing (a little more important) is the <welcome-file-list>
element.  I have one such in my web.xml and it contains one
<welcome-file> element.  This is directly from it:



This should redirect anyone going to https://localhost/ to
llerServlet.  This is not the case however since it's not happening.
Instead I'm getting the directory listing of the root of the webapp (I
don't have an index file).

Now I have two questions:
1) Why doesn't my welcome-file-list thing work?
2) How can I disable the directory listing?  I want people to see the
"not found" or "not authorized" rather than getting the directory

One final thing (web.xml is _very_ poorly documented... btw, I _have_
searched for answers to my questions and haven't found anything to
thing I'm asking about here ;o).

Can someone explain to me the <error-page> tag in web.xml?  I want an
error page for my servlets as well as the JSPs.  I've put the <%@ page
errorPage="error.jsp" %> in all of them but I'm wondering what to do
with the servlets...  I think it might have something to do with the
<error-page> tag in web-xml but the documentation says that it takes
an error code (such as 404).  Another place says it takes the fully
qualified name of a java exception class.  Can I use the error.jsp
for these things too?  Will that page have access to the exception
object to get the message I want to display?
I'm talking about it looking like this in web.xml:


Thanks in advance for any and all answers,

kind regards, Stefan

Stefan Freyr Stefansson
Software Developer
deCODE Genetics, Inc.

Phone: (+354) 570 2854
GSM:   (+354) 861 1718
Fax:   (+354) 491 3782

 <<Stefan Stefansson.vcf>>


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

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

View raw message