protected org.apache.struts.action.ActionForward | doExecute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
CustomerForm frm = ( CustomerForm ) form;
Customer cust = frm.getCustomer( );
try
{
getPetstore( ).createCustomer( cust );
return mapping.findForward( SUCCESS );
}
catch ( DuplicateAccountException da )
{
request.setAttribute( MESSAGE_KEY, "duplicate_account" );
return mapping.findForward( ERROR );
}
catch ( DuplicateEmailException de )
{
request.setAttribute( MESSAGE_KEY, "duplicate_email" );
return mapping.findForward( ERROR );
}
|