This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error Redirection w/Params?

 
Greg Donahue
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic