You can use the @jpf:exception-handler annotation to mark an error handler method that is specified by a @jpf:catch annotation in a page flow. Without a @jpf:exception-handler annotation, the page flow runtime will not route exceptions to an error handler method.
For more information about using this annotation, see Handling Exceptions in Page Flows.
@jpf:exception-handler
[ read-only = "{ true | false }" ]
Optional. The default is read-only="false".
Use this attribute to indicate your intention that this method
The following rules apply to this annotation's use:
package login2;
import com.bea.wlw.netui.pageflow.PageFlowController;
import com.bea.wlw.netui.pageflow.Forward;
import com.bea.wlw.netui.pageflow.FormData;
import javax.servlet.http.HttpServletRequest;
import javax.security.auth.login.FailedLoginException;
/**
* @jpf:controller nested="true"
*/
public class Login extends PageFlowController
{
public String userName;
/**
* @jpf:action
* @jpf:forward name="success" path="LoginSuccess.jsp"
* @jpf:catch type="FailedLoginException" method="failedLogin"
*/
protected Forward loginSubmit( LoginForm loginForm )
throws Exception
{
login( loginForm.getUsername(), loginForm.getPassword() );
userName = loginForm.getUsername();
return new Forward( "success", loginForm );
}
/**
* @jpf:exception-handler
* @jpf:forward name="loginPage" path="Login.jsp"
*/
protected Forward failedLogin( FailedLoginException ex, String actionName,
String message, FormData form )
{
LoginForm loginForm = ( LoginForm ) form;
loginForm.setMessage( "Login incorrect. Do you need to create an account?" );
return new Forward( "loginPage" );
}
.
.
.
/** * Invalid code: * @jpf:exception-handler * @jpf:catch type="Exception" path="foo.jsp" */ public Forward bad( Exception e, String msg, String msgKey, ActionForm form )