aspose file tools*
The moose likes JSF and the fly likes Exception Handling - using an error page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Exception Handling - using an error page" Watch "Exception Handling - using an error page" New topic
Author

Exception Handling - using an error page

Kurt Boets
Greenhorn

Joined: Oct 19, 2004
Posts: 14
Hello,

I am trying to assure correct exception handling; depending on the exception, the user is forwared to an error page.
I did develop a Filter class, an ErrorAwareRequestWrapper class that wraps the http error codes.
When I do a deploy (on a BEA Weblogic 8.1) I receive an error.
Hereby I will show you my :
  • The Filter class.
  • The ErrorAwareRequestWrapper class
  • The web.xml file
  • The stack trace of the exception thrown by the server










  • Has anyone yet expercience with handling exceptions using error pages or
    filters ?
    All help is welcome.
    Thx,
    Varun Khanna
    Ranch Hand

    Joined: May 30, 2002
    Posts: 1400
    Try to make your ErrorHandlerFilter class "public"


    - Varun
    Kurt Boets
    Greenhorn

    Joined: Oct 19, 2004
    Posts: 14
    Indeed, it works now.
    Thx,
    Dinesh Gupta
    Greenhorn

    Joined: Mar 16, 2009
    Posts: 1
    Hi,

    This a very useful post. I want to implement same type of filter.
    I am using JSF and Struts tiles component.
    The problem is that sendError method of the ErrorAwareRequestWrapper is not called.

    If anyone have idea, Please reply.
     
    It is sorta covered in the JavaRanch Style Guide.
     
    subject: Exception Handling - using an error page