Re: error-page directive gives a wrong response code to apache

2003-10-22 Thread Tim Funk
If you have a custom error page, its the job of the page to explicitly set 
the error code. This is because errors may *not* be errors and the error page 
may have logic to recover from various errors.

You'll see this behavior in other servlet engines too.

In your error page, you'll need this snippet:
%response.setStatus(HttpServletResponse.SC_NOT_FOUND);%
-Tim

Julien Oix wrote:
hi everyone,

I have a problem with the error-page directive included in my web.xml

The RPM's I use on a Linux RedHat top box :

apache-1.3.27-2.7.1
tomcat4-4.1.18-full.1jpp
mod_jk-ap13-1.2.2-1jpp
so when apache gives a jsp to Tomcat, this one answers a code 200 instead of
a 404 in the apache log even if the jsp is not found ...
I know this bug is in the bugzilla database as RESOLVED yet (
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15406 ) but for 4.1.12
version so I can't understand what happens ...
the interesting part of my web.xml :


error-page
error-code403/error-code
location/error/403.jsp/location
/error-page
error-page
error-code404/error-code
location/error/404.jsp/location
/error-page
##



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: error-page directive gives a wrong response code to apache

2003-10-22 Thread Johann Uhrmann
Julien Oix wrote:
hi everyone,

I have a problem with the error-page directive included in my web.xml

The RPM's I use on a Linux RedHat top box :

apache-1.3.27-2.7.1
tomcat4-4.1.18-full.1jpp
mod_jk-ap13-1.2.2-1jpp
so when apache gives a jsp to Tomcat, this one answers a code 200 instead of
a 404 in the apache log even if the jsp is not found ...
I know this bug is in the bugzilla database as RESOLVED yet (
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15406 ) but for 4.1.12
version so I can't understand what happens ...
It is RESOLVED INVALID. In other words:
That behaviour is considered correct.
If You want Your JSP to return a response code different from 200
You have to include:
% response.setStatus(response.SC_NOT_FOUND); %

in Your 404-page.

Regards,

Johann Uhrmann

--
Johann Uhrmann
xpecto AG | Lindenstrasse 81 | D-84030 Ergolding
Telefon: 0700 xpecto 00 (0700 973286 00)
Telefax: 0700 xpecto 10 (0700 973286 10)
Internet: http://www.xpecto.com
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: error-page directive gives a wrong response code to apache

2003-10-22 Thread Julien Oix
it works great !

thanks a lot for your tip's, both Tim  Johann :-)

Julien OIX
Service Informatique de Gestion - Universite de Nantes
Tel: 02 40 99 83 65 / abroad + (33) 240 99 83 65
Web: http://www.univ-nantes.fr
mailto:[EMAIL PROTECTED]

 -Message d'origine-
 De : Tim Funk [mailto:[EMAIL PROTECTED]
 Envoye : mercredi 22 octobre 2003 14:25
 A : Tomcat Users List
 Objet : Re: error-page directive gives a wrong response code to apache


 If you have a custom error page, its the job of the page to
 explicitly set
 the error code. This is because errors may *not* be errors and
 the error page
 may have logic to recover from various errors.

 You'll see this behavior in other servlet engines too.

 In your error page, you'll need this snippet:
 %response.setStatus(HttpServletResponse.SC_NOT_FOUND);%

 -Tim

 Julien Oix wrote:
  hi everyone,
 
  I have a problem with the error-page directive included in my web.xml
 
  The RPM's I use on a Linux RedHat top box :
 
  apache-1.3.27-2.7.1
  tomcat4-4.1.18-full.1jpp
  mod_jk-ap13-1.2.2-1jpp
 
  so when apache gives a jsp to Tomcat, this one answers a code
 200 instead of
  a 404 in the apache log even if the jsp is not found ...
 
  I know this bug is in the bugzilla database as RESOLVED yet (
  http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15406 ) but for 4.1.12
  version so I can't understand what happens ...
 
 
  the interesting part of my web.xml :
 
  
  error-page
  error-code403/error-code
  location/error/403.jsp/location
  /error-page
 
  error-page
  error-code404/error-code
  location/error/404.jsp/location
  /error-page
 
  ##
 


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]