webtier@glassfish.java.net

Re: [webtier] error page in jsf

From: <webtier_at_javadesktop.org>
Date: Wed, 25 Feb 2009 07:08:32 PST

i have a web application. i used glass fish v2 with netbeans 6.5, Jsf 1.2.
i want to handle some Business exceptions or any exception and redirect to error page.
That is my code

// managed bean "This is action on a button"
 public String testAction()throws RuntimeException{
//some codes
  searchService.businessLogicMethod();
}

// search service class

 public void businessLogicMethod( ) throws RuntimeException {

         System.out.println("BusinessLogic Method Called");
         // what ever code
        throw new RuntimeException();
     }
and define all error code and type in web.xml

<error-page>
     <exception-type>java.lang.RunTimeException</exception-type>
    <location>/errorPage.jsp</location>
</error-page>
 <error-code>500</error-code>
    <location>/errorPage.jsp</location>
</error-page>
 <error-code>503</error-code>
    <location>/errorPage.jsp</location>
</error-page>

[b]But it doesn't redirect neither my error page OR server error page.
It stopped at the same page.[/b]

[b]Even if any Unhandled exception fired. it will be redirected to my error page.[/b]

Please any one can help me,
Thanks advice.
[Message sent by forum member 'nhassona' (nhassona)]

http://forums.java.net/jive/thread.jspa?messageID=333795