jakarta-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent-Olivier Arsenault" <vinc...@stria.com>
Subject servlet 404 error handling
Date Fri, 14 Jan 2000 00:10:01 GMT
Hi!


Here's what I want to do:


When a request is made trough apache, it looks for the requested file, if it
does't find it on the file system, I want the 404 error document to be
generated by a custom servlet, which generates xml as a thin client
for a remote application server (ejb). The requested url may be valid (not
return a 404) because there is no xml document in the filesystem at all,
they are all generated by the servlet.


what I have:


-tomcat (monday's cvs)
-apache 1.3.9 (release version)


what I did:


in httpd.conf :


ErrorDocument 404 /RequestParam


in web.xml:


<error-page>
 <error-code>404</error-code>
 <location>/RequestParam</location>
</error-page>



Ok here's my problem, let say I want
"/shop/jazz/louis-armstrong/wondeful-world/1254588.html" the shop directory
is not there, so the 404 is sent to RequestParam, and RequestParam is a
servlet
that displays all the parameters and request's header infos.

This is the output I get:


URI : /RequestParam

PathInfo : null

ServletPath : /RequestParam

accept : image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/vnd.ms-excel, application/msword, application/vnd.ms-powerpoint,
*/*

accept-encoding : gzip, deflate

host : fusion3.stria.ca

accept-language : en-us

connection : Keep-Alive

user-agent : Mozilla/4.0 (compatible; MSIE 5.01; Windows 98)



Everything looks fine, but, apache is supposed
to also send those parameters in case of a 404 error (and I don't see them):


REDIRECT_HTTP_ACCEPT
REDIRECT_HTTP_USER_AGENT
REDIRECT_PATH
REDIRECT_QUERY_STRING
REDIRECT_REMOTE_ADDR
REDIRECT_REMOTE_HOST
REDIRECT_SERVER_NAME
REDIRECT_SERVER_PORT
REDIRECT_SERVER_SOFTWARE
REDIRECT_URL

I absolutly need to know the real path for this to work and I don't see any
way of getting it.
I would appreciate any suggestion as I may be on a completly wrong path
here.


thanks
--vincent



Mime
View raw message