tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: custom error pages
Date Thu, 05 Aug 2004 13:11:21 GMT

Hi,
The stuff in conf/web.xml is virtually appended to your web.xml.  If
your web.xml is inactive or non-existent the stuff in conf/web.xml is
not applicable and not consulted.


Yoav Shapira
Millennium Research Informatics


>-----Original Message-----
>From: Maurice Marrink [mailto:maurice.marrink@topicus.nl]
>Sent: Thursday, August 05, 2004 8:56 AM
>To: Tomcat Users List
>Subject: RE: custom error pages
>
>Hi,
>Thanks for the reply.
>I think you might have misunderstood my second request.
>Tomcat allows you to define custom errorpages by specifying them in the
>conf/web.xml file as a default for all webapps (existing or
nonexisting)
>What I would like to request is that these defaults are checked before
>sending the tomcat error. Imo this is not a hack, what I did with the
>listeners was a hack and I thought I made that clear.
>Maybe I need to clarify this a bit more.
>If I specify a custom errorpage in the /conf/web.xml it is this error
>(provided I used the right http error code) that gets shown whenever I
>go to a non existing webapp/url. What I would like is to have a stopped
>webapp behave in the same way. (at least for errorpages).
>
>Maurice Marrink
>
>
>-----Oorspronkelijk bericht-----
>Van: Shapira, Yoav [mailto:Yoav.Shapira@mpi.com]
>Verzonden: donderdag 5 augustus 2004 14:37
>Aan: Tomcat Users List
>Onderwerp: RE: custom error pages
>
>
>Hi,
>I'll save you time and tell you your 2nd request will not happen.  A
>webapp is a webapp including its error pages.  If it's off, it's off,
>including its error pages.  We won't put in hacks like hard-coding a
>backup location for error pages.
>
>Yoav Shapira
>Millennium Research Informatics
>
>
>>-----Original Message-----
>>From: Maurice Marrink [mailto:maurice.marrink@topicus.nl]
>>Sent: Thursday, August 05, 2004 3:53 AM
>>To: tomcat-user@jakarta.apache.org
>>Subject: custom error pages
>>
>>Hi,
>>
>>I,m using tomcat 5.0.27 and am trying to show custom error pages.
>>I added a couple of errorpage tags to my webapps web.xml and the
>>/conf/web.xml in the tomcat installation dir.
>><error-page>
>>		<error-code>500</error-code>
>>		<location>/error/error.html</location>
>></error-page>
>>and after telling internet explorer not to use userfriendly errorpages
>it
>>shows the errorpages defined in my webapp when I try to access an
>>nonexisting url inside my webapps context (e.g.
>>/my_existing_webapp/does_not_exist.html) and shows the default
>errorpages
>>when I go to an url that does not exist at all (e.g.
>>/non_existing_webapp/whatever.html), that is after I copied my error
>files
>>into the ROOT context.
>>But I cant get it to work when my webapp is defined but not running.
>What I
>>did was this:
>>- start tomcat
>>- goto the manager webapp
>>- shutdown the webapp with custom errorpages
>>- enter a valid url for that webapp in the browser.
>>
>>Now I get the standard tomcat errorpage.
>>So I did a little debugging and found that when tomcat stops a webapp,
>it
>>preserves the context it just strips it from all but the name (well
>>almost).
>>So my custom defined errorpages are gone and because tomcat did find a
>>context it wont use the errorpages defined in the default web.xml (or
>root
>>context) but instead goes for the tomcat errorpage.
>>
>>I thought I could outsmart tomcat, so I made a little lifecylelistener
>and
>>container listener so I would get notified of the removal of my
>errorpages
>>and then put them back in. Even though that works, tomcat still shows
>its
>>own errorpages because further down the line it tries to get a
>>requestdispatcher from the context (which was stripped) to forward the
>>request for the errorpages. And there it fails offcourse.
>>
>>Now we get to the question(s) :)
>>
>>- does anyone know what else needs to be preserved in the context in
>order
>>to deliver a valid requestdispatcher (there is a lot that gets
removed,
>and
>>its probably quicker to get an answer from you guys then painstakingly
>use
>>trial and error)
>>- or perhaps a better question could you guys (developers) make the
>next
>>(nightly) release so that it tries to get errorpages from the default
>>web.xml (root context) before showing the tomcat errorpage. Because
its
>>more
>>then likely my little hack is going to break something if I get it to
>work.
>>
>>If no one can or bothers to answer the first question I can live with
>that,
>>I've surrendered :) but I would like to see the 2nd request/ feature
to
>>happen.
>>
>>Thanks,
>>
>>Maurice Marrink
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>
>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: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org




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: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message