Hi All,

I'm new to Struts, so please bear with me :). I've a form asking for
customer data with fields
like name, address etc.  What I'm trying to achieve is this kind of flow/design:

 Page1) Customer enters their info. Submit button will take them to Page2.
 Page2) They are asked to verify the same info again with read only
 fields. Two buttons will be there, Confirm/Submit and Change. Change
 will take them to Page1 and Confirm/Submit will take them to Page3.
 Page3) The info is displayed to them again after entering it into the DB.

What i see is the control never goes to  CustomerConfirmAction class.
What I'm doing wrong?  Any help is appreciated.

Thanks, Deep

I've the following configuration and code.

        <action-mappings>
                <action path  = "/customerCreate"
                        type  = "customer.CustomerAction"
                        scope = "request"
                        input = "/jsp/customer/CustomerCreate.jsp"
                        name  = "customerForm">
                <forward name="customerConfirm" 
path="/jsp/customer/CustomerConfirm.jsp"/>                      
                </action>       
                <action path  = "/customerConfirm"
                        type  = "customer.CustomerConfirmAction"
                        scope = "request"
                        name  = "customerForm"
                        input = "/jsp/customer/CustomerConfirm.jsp">
                  <forward name="customerView"
path="/jsp/customer/CustomerView.jsp"/>                         </action>
        </action-mappings>

CustomerCreate.jsp:
<html:form action="customerCreate" method="POST">

        <TABLE border="0" width="700">
                <TR>
                        <TD>First Name</TD>
                        <TD><html:text property="customer.firstName" /></TD>
                </TR>
                 ... ....
                <TR>
                        <TD><html:submit property="submit" /></TD>
                        <TD><html:cancel property="cancel" /></TD>
                </TR>

CustomerConfirm.jsp:
<html:form action="customerConfirm" method="POST">

        <TABLE border="0" width="700">
                <TR>
                        <TD>First Name</TD>
                        <TD><bean:write name="customer" property="firstName" 
/></TD>
                </TR>

CustomerAction.java:
                CustomerForm cf = (CustomerForm)form;
                Customer customer = cf.getCustomer();
                request.setAttribute("customer", customer);
                return mapping.findForward("customerConfirm");

CustomerConfirmAction.java:
                Customer customer = (Customer)request.getAttribute("customer");
                request.setAttribute("customer", customer);
                DAOFactory daf = 
DAOFactory.getFactory(DAOFactory.FACTORY_MYSQL);
                
                CustomerDAO custDAO = daf.getCustomerDAO();
                if (custDAO.insertCustomer(customer) > 0) {
                        return mapping.findForward("customerView");
                }

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to