wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Error Redirection w/Params? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Error Redirection w/Params?" Watch "Error Redirection w/Params?" New topic
Author

Error Redirection w/Params?

Greg Donahue
Greenhorn

Joined: Oct 07, 2003
Posts: 24
Hi,
I'm trying to set up a web application so that all kinds of server errors (400, 401, 403, 404) redirect to a single JSP. My idea was the following, in web.xml, we can specify how redirection is supposed to happen, right? Like so:
<web-app>
<error-page>
<error-code>404</error-code>
<location>/jsp/error.jsp?ec=404</location>
</error-page>
</web-app>
My reasoning was that I could just add ?ec=404 to the URL and then read the request object's "ec" parameter from within /jsp/error.jsp. This isn't working, for some reason. Does doing redirection in this way invalidate the request object? Is there some other way of redirecting multiple errors to one page, then figuring out which is which on the page?
Thanks,
Greg D


vi veri veniversum vivus vici
 
Consider Paul's rocket mass heater.
 
subject: Error Redirection w/Params?
 
Similar Threads
disable tomcat version display
how to trap 404 error
Tomcat settings in an production environment?
error page under WEB-INF
response.sendError & error-page