If I do that then I don't see a jsp page asking me to Confirm the data. It goes to the ConfirmAction class but as I said, what I want is
Enter info on Page1. Ask for confirmation on Page2 and then insert the data in DB using DataAccess object. Display the data on Page3 that was entered by the user indicating customer is created. I thought this should be very simple ...a very very common use case. Thanks Deep On 10/9/05, Jeremiah Johnson <[EMAIL PROTECTED]> wrote: > your path for the "customerConfirm" forward should be > "/customerConfirm.do" probably but it might be "/do/customerConfirm" > depending on what you have in your web.xml. > /Jeremiah > > > Deep Chand wrote: > > 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] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]