• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Error Redirection w/Params?

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic