• Post Reply Bookmark Topic Watch Topic
  • New Topic

Filters and custom error pages

 
John O'Hanley
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Custom error pages can be configured in web.xml.

When I use a Filter that wraps the response, the usual mechanism for serving custom error pages goes haywire. Why?

GOOD:
No filter:
custom error pages served OK.

GOOD:
Filter added, but does no wrapping of the response:
custom error pages served OK.

GOOD:
Filter added, wraps response, and
*filter code itself* throws an error :
custom error pages served OK.

BAD:
Filter added, wraps response, and
code *other than filter code* throws an error :
custom error pages NOT served.
Instead, a generic server error page is served.

WRONG ANSWER:
"Configure a dispatcher element for ERROR."
No, doesn't fix. Doesn't even apply, since such config
refers to when to *apply* a filter, not how errors
themselves are handled.

(Using Servlet2.4, Tomcat 5.5)

How do I ensure that my custom error pages are always
served, regardless of what filters are active?

- Perplexed.
 
Pierre Galle
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi john,

Have you been able to fix this problem? I am facing the same issue.

Please let me know.

Pierre
 
John O'Hanley
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, no luck so far. If I find an answer, I will post it...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!