tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefán F. Stefánsson <stef...@snote.decode.is>
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,
	Stefan

-----Original Message-----
From: Chris Haynes [mailto:chris@harvington.org.uk]
Sent: 27. febrúar 2001 12:56
To: tomcat-user@jakarta.apache.org
Subject: Re: webapp icons, disabling directory listings, and
<error-page> tags in web.xml


Stefan,

You can turn off the generation of indexes by setting the argument
suppress="true"
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
try{
   }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.

Chris
Evesham
England

----- Original Message -----
From: "Stefán F. Stefánsson" <stefanf@snote.decode.is>
To: "Tomcat-User" <tomcat-user@jakarta.apache.org>
Cc: "JSP-Interest" <jsp-interest@java.sun.com>
Sent: Tuesday, February 27, 2001 12:40 PM
Subject: webapp icons, disabling directory listings, and <error-page>
tags in web.xml


Hello.

I was wondering if anyone knows if the <icon> element in web.xml is
not
working in Tomcat (it's not working for me... just wondering if it's
not
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:

<welcome-file-list>

<welcome-file>/servlet/com.decode.ips.webservice.controller.IPSControl
le
rServlet</welcome-file>
</welcome-file-list>

This should redirect anyone going to https://localhost/ to
https://localhost/servlet/com.decode.ips.webservice.controller.IPSCont
ro
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
listing.

One final thing (web.xml is _very_ poorly documented... btw, I _have_
searched for answers to my questions and haven't found anything to
this
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
in
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
file
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:

<error-page>
  <error-code>javax.servlet.ServletException</error-code>
  <location>/error.jsp</location>
</error-page>

Thanks in advance for any and all answers,

kind regards, Stefan


--------------------------------------------
Stefan Freyr Stefansson
Software Developer
deCODE Genetics, Inc.
http://www.decode.com

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

 <<Stefan Stefansson.vcf>>



----------------------------------------------------------------------
----------


> --------------------------------------------------------------------
-
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-user-help@jakarta.apache.org


Mime
View raw message