Anybody jump in and say if there's a better way to do this...
I am attempting to create a simple multistep application for gathering registration information. Each page will be validated using the Validator framework. I stumbled across the LookupDispatchAction and thought it might be useful for what I am trying to do. I am getting an exception:
javax.servlet.ServletException: DispatchMapping[/RegisterLogonInfo] does not define a handler property org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:191) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) javax.servlet.http.HttpServlet.service(HttpServlet.java:763) javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
Here's the relevant parts of struts-config.xml: [snip] <form-bean name="registerLogonInfo" type="org.apache.struts.validator.DynaValidatorForm"> <form-property name="logonIdWidgetsSubFormId" type="java.lang.String"/> <form-property name="passwordWidgetsSubFormPassword1" type="java.lang.String"/> <form-property name="passwordWidgetsSubFormPassword2" type="java.lang.String"/> </form-bean> [snip]
<action path="/go4it" type="org.apache.struts.actions.ForwardAction" name="registerLogonInfo" scope="session" input="tiles.registerLogonInfo" parameter="tiles.registerLogonInfo"/> />
<action path="/RegisterLogonInfo" type="fi.els.action.WizardAction" name="registerLogonInfo" validate="true" input="tiles.registerLogonInfo"> <forward name="previous" path="/previous.html"/> <forward name="next" path="/next.html"/> </action>
The WizardAction class follows:
package fi.els.action;
import javax.servlet.ServletException; import org.apache.struts.action.*; import org.apache.struts.actions.*; import javax.servlet.http.*; import java.util.*;
public class WizardAction extends LookupDispatchAction { public ActionForward next ( ActionMapping mapping, ActionForm form, HttpServletRequest request ) { return mapping.findForward("next"); }
public ActionForward previous ( ActionMapping mapping, ActionForm form, HttpServletRequest request ) { return mapping.findForward("previous"); }
public ActionForward finish ( ActionMapping mapping, ActionForm form, HttpServletRequest request ) { return mapping.findForward("finish"); }
protected Map getKeyMethodMap() { Map keyMethodMap = new HashMap(); keyMethodMap.put("button.previous", "previous"); keyMethodMap.put("button.next", "next"); keyMethodMap.put("button.finish", "finish"); return keyMethodMap; } }
Any idea what I'm doing wrong? Is there a better way to do this? Dean Hoover
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]