Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: Handling exceptions in a custom result

Vinod Singh

2007-08-07

Replies:

Do something like below-

<action ...>
 <result name="error">path_to_error.jsp</result>
</action>

  public void execute(ActionInvocation invocation) throws Exception {
    try {
      // Some operations
    } catch (Exception e) {
      //Send user to a error page
      return "error";      
    }
  }
Vinod

-------- Original Message --------
Subject: Handling exceptions in a custom result
From: Juan Damasceno <juan.damasceno@(protected)>
To: user@(protected)>
Date: Tuesday, August 07, 2007 4:56:41 PM
> I need to do something like:
>
>   public void execute(ActionInvocation invocation) throws Exception {
>      try {
>        // Some operations
>      } catch (Exception e) {
>        //Send user to a error page
>      }
>   }
>
> Any idea?
>
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.