File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error Redirection w/Params?