FileDocCategorySizeDatePackage
UpdateCustomerAction.javaAPI DocJBoss 4.2.11903Fri Jul 13 20:56:04 BST 2007xpetstore.web.struts.action.customer

UpdateCustomerAction

public class UpdateCustomerAction extends xpetstore.web.struts.action.BaseAction
author
Herve Tchepannou
struts.action
name="customerForm" path="/updateCustomer" scope="request" validate="true" input="/myaccount.jsp"
struts.action-forward
name="success" path="/index.jsp"
struts.action-forward
name="error" path="/myaccount.jsp"

Fields Summary
Constructors Summary
Methods Summary
protected org.apache.struts.action.ActionForwarddoExecute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)

see
xpetstore.web.struts.action.BaseAction#doExecute(ActionMapping, ActionForm, HttpServletRequest, HttpServletResponse)

        CustomerForm  frm = ( CustomerForm ) form;
        Customer cust = frm.getCustomer(  );

        try
        {
            getPetstore(  ).updateCustomer( cust );

            initSession( cust, request );

            return mapping.findForward( SUCCESS );
        }
        catch ( DuplicateEmailException de )
        {
            request.setAttribute( MESSAGE_KEY, "duplicate_email" );

            return mapping.findForward( ERROR );
        }