Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 78803 invoked by uid 500); 4 Jul 2001 07:39:30 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: tomcat-user@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 78541 invoked from network); 4 Jul 2001 07:39:24 -0000 Received: from cgey1.capgemini.se (HELO cormrw2.cgey.com) (193.234.247.50) by h31.sny.collab.net with SMTP; 4 Jul 2001 07:39:24 -0000 Received: from mailsweeper.capgemini.se (mailsweeper.capgemini.se [192.176.203.17]) by cormrw2.cgey.com (8.11.3/8.11.3) with ESMTP id f647dRE87266 for ; Wed, 4 Jul 2001 09:39:27 +0200 (CEST) (envelope-from tim.hughes@capgemini.no) Received: from master04.capgemini.se (unverified) by mailsweeper.capgemini.se (Content Technologies SMTPRS 4.2.1) with ESMTP id for ; Wed, 4 Jul 2001 09:29:53 +0200 Received: by master04.capgemini.se with Internet Mail Service (5.5.2653.19) id ; Wed, 4 Jul 2001 09:39:20 +0200 Message-ID: <086757ACB14DD211A2B900805FBB0B8D07A4FADF@OSL01> From: "Hughes, Tim" To: "'tomcat-user@jakarta.apache.org'" Subject: RE: http errors Date: Wed, 4 Jul 2001 09:39:20 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/alternative ; boundary="----_=_NextPart_001_01C1045C.6FB6D540" X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C1045C.6FB6D540 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable Hi, =20 You will find a full copy of the **default** web.xml in TOMCAT_HOME/conf/. =20 What is the default web.xml --> Extract from the user guide (which you will find at TOMCAT_HOME\doc\uguide\tomcat_ug.html: recommended reading) [A detailed description of web.xml and the web application structure (including directory structure and configuration) is available in chapters 9, 10 and 14 of the Servlet API Spec and we are not going to write about it.=20 There is however a small Tomcat related "feature" that is related to web.xml. Tomcat lets the user define default web.xml values for all context by putting a default web.xml file in the conf directory. When constructing a new Context, Tomcat uses the default web.xml file as the base configuration and the application specific web.xml (the one located in the application's WEB-INF/web.xml), only overwrite these defaults.] So if you want the error pages to apply to all webapps then you put the error page tags in the default web.xml like this: =20 javax.servlet.TryagainException /errors/TryAgain.html =20 503 /errors/TryAgain.html (I assume that you have renamed the directories and files accordingly: errors directory and TryAgain.html file are only examples). If you only want the error pages to apply to a particular webapp then you should create a web.xml file that you place in TOMCAT_HOME/webapps/yourWebApp/WEB-INF. This file should look like this: javax.servlet.TryagainException /errors/TryAgain.html =20 503 /errors/TryAgain.html I hope this works. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=20 Tim Hughes=20 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=20 -----Original Message----- From: Francisco Areas Guimaraes [mailto:fareas@larc.usp.br] Sent: 4. juli 2001 02:25 To: tomcat-user@jakarta.apache.org Subject: Re: http errors it didn=B4t work...could you please give a "complete" web.xml? and where should I put this file? in %TOMCAT_HOME%/conf or somewhere else? I=B4m using tomcat 3.2.2 and win2k, I would like any help you could provide, because I just started working with tomcat. =20 thanks, =20 Francisco fareas@larc.usp.br =20 ----- Original Message -----=20 From: Hughes, Tim=20 To: 'tomcat-user@jakarta.apache.org' =20 Sent: Tuesday, July 03, 2001 4:29 AM Subject: RE: http errors Hi, =20 Using elements in the web.xml, you can program web applications to handle HTTP errors and exceptions. =20 The deployment description below makes the container send the /errors/TryAgain.html file if either a TryAgainExeption or the HttpServletResponse.SC_SERVER_UNAVAILABLE error code occurs: =20 =20 =20 javax.servlet.TryagainException /errors/TryAgain.html =20 503 /errors/TryAgain.html =20 I hope this helps. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=20 Tim Hughes=20 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=20 -----Original Message----- From: Francisco Areas Guimaraes [mailto:fareas@larc.usp.br] Sent: 3. juli 2001 02:15 To: Lista tomcat User Subject: http errors Anyone know if I can set tomcat to use a custom page for http errors, like 500, instead of it=B4s default??? =20 please, help me, i=B4ve tried a lot of things and it didn=B4t help. =20 []=B4s Francisco This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst & Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. This message contains information that may be privileged or confidential an= d is the property of the Cap Gemini Ernst & Young Group. It is intended onl= y for the person to whom it is addressed. If you are not the intended recip= ient, you are not authorized to read, print, retain, copy, disseminate, dis= tribute, or use this message or any part thereof. If you receive this messa= ge in error, please notify the sender immediately and delete all copies of = this message. ------_=_NextPart_001_01C1045C.6FB6D540 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,
 
You will = find a full=20 copy of the **default** web.xml in TOMCAT_HOME/conf/.
 
What is t= he default=20 web.xml --> Extract from the user guide (which you will find at=20 TOMCAT_HOME\doc\uguide\tomcat_ug.html: recommended reading)
[<= /FONT>A detailed descripti= on of=20 web.xml and the web application structure (including directory structure an= d=20 configuration) is available in chapters 9, 10 and 14 of the = Servlet API=20 Spec and we are not going to write a= bout it.=20

There is however a small Tomcat relate= d=20 "feature" that is related to web.xml. Tomcat lets the user define default= w eb.xml values for all context by putting a default web.xml file in the con= f=20 directory. When constructing a new Context, Tomcat uses the default web.xml= file=20 as the base configuration and the application specific web.xml (the one loc= ated=20 in the application's WEB-INF/web.xml), only overwrite these defaults.]

So if= you want=20 the error pages to apply to all webapps then you put the error page tags in= the=20 default web.xml like this:

<?xml version=3D"1.0" encoding=3D"ISO-8859-1"?>

<!DOCTYPE web-app

PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"

"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>

<!--&n= bsp;IMPORTANT: all=20 the tags that were already in the default web.xml file should remain i= n the=20 file -->
 
<error-page>
<exception-type>javax.servlet.TryagainException</exception-type>
<location>/errors/TryAgain.html</location>
</error-page>
 
<error-page>
<error-code>503</error-code><= /DIV>
<location>/errors/TryAgain.html</location>
</error-page>

</web-app>

(I as= sume that=20 you have renamed the directories and files accordingly: errors directory an= d=20 TryAgain.html file are only examples).

If yo= u only want=20 the error pages to apply to a particular webapp then you should create a we= b.xml=20 file that you place in TOMCAT_HOME/webapps/yourWebApp/WEB-INF. This file sh= ould=20 look like this:

<!= DOCTYPE=20 web-app

PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"

"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">

<web-app>

<error-page>
<exception-type>javax.servlet.TryagainException</exception-type>
<location>/errors/TryAgain.html</location>
</error-page>
 
<error-page>
<error-code>503</error-code><= /DIV>
<location>/errors/TryAgain.html</location>
</error-page>

</web-app>

=

I hop= e this=20 works.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Tim Hughes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-----Original Message-----
From: Francisco Areas Guima= raes=20 [mailto:fareas@larc.usp.br]
Sent: 4. juli 2001 02:25
To:<= /B>=20 tomcat-user@jakarta.apache.org
Subject: Re: http=20 errors

it didn=B4t work...could you please give= a=20 "complete" web.xml? and where should I put this file? in %TOMCAT_HOME%/co= nf or=20 somewhere else? I=B4m using tomcat 3.2.2 and win2k, I would like any help= you=20 could provide, because I just started working with tomcat.
 
thanks,
 
Francisco
fareas@larc.usp.br
----- Original Message -----
F= rom:=20 Hugh= es,=20 Tim
To: 'tomcat-user@jakarta.a= pache.org'=20
Sent: Tuesday, July 03, 2001 4:2= 9=20 AM
Subject: RE: http errors

Hi,
 
Using= <error-page> elements in the web.xml, you can program web applica= tions=20 to handle HTTP errors and exceptions.
 
The d= eployment=20 description below makes the container send the /errors/TryAgain.html fi= le if=20 either a TryAgainExeption or the HttpServletResponse.SC_SERVER_UNAVAILA= BLE=20 error code occurs:
 
<web-app>
 
<!= -- Servlet=20 definitions -->
 
<error-page>
<exception-type>javax.servlet.Tryagain= Exception</exception-type>=
<location>/errors/TryAgain.html</location>
</error-page>
 
<error-page>
<error-code>503</error-code>
<location>/errors/TryAgain.html</location>
</error-page>
 
I hope this helps.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=20
Tim Hughes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

-----Original Message-----
From: Francisco Areas= Guimaraes [mailto:fareas@larc.usp.br]
Sent: 3. juli 2001=20 02:15
To: Lista tomcat User
Subject: http=20 errors

Anyone know if I can set tomcat to u= se a=20 custom page for http errors, like 500, instead of it=B4s=20 default???
 
please, help me, i=B4ve tried a lot = of things=20 and it didn=B4t help.
 
[]=B4s
Francisco
<= CODE>

This message contains information that may be privileg= ed or=20 confidential and is the property of the Cap Gemini Ernst & Young Gr= oup.=20 It is intended only for the person to whom it is addressed. If you are = not=20 the intended recipient, you are not authorized to read, print, retain, = copy,=20 disseminate, distribute, or use this message or any part thereof. If yo= u=20 receive this message in error, please notify the sender immediately and= delete all copies of this=20 message.

This message contains information that may be privileged or confidential an= d is the property of the Cap Gemini Ernst & Young Group. It is intended onl= y for the person to whom it is addressed. If you are not the intended recip= ient, you are not authorized to read, print, retain, copy, disseminate, dis= tribute, or use this message or any part thereof. If you receive this messa= ge in error, please notify the sender immediately and delete all copies of = this message.
------_=_NextPart_001_01C1045C.6FB6D540--