Hi Nagi,

Below is the action class code:

public class Tr518page1Action extends DispatchAction {
        
        //String businessNum = null;

        /**
        * Constructor
        */
        public Tr518page1Action() {

                super();

        }


        public ActionForward create(
            ActionMapping mapping, 
            ActionForm form, 
            HttpServletRequest request, 
            HttpServletResponse response) 
          throws IOException, ServletException { 
        
                String statusCode = null;
                String businessNum = "zero";

                HttpSession session = request.getSession();
                session.setAttribute("businessNumber",
businessNum);                   
                
                
                ActionErrors errors = new ActionErrors();
                ActionForward forward = new ActionForward();
                // return value
                Tr518Form tr518Form = (Tr518Form) form;
                
        
                //String dispatch = tr518Form.getDispatch();

                try {
                        
                        if
(session.getAttribute("businessNumber").equals("zero")) {

                                Insert518page1 insertpg1 = new
Insert518page1();
                                businessNum =
insertpg1.ins518pg1(tr518Form);
                                
                                System.out.println("businessNumber  : "
+  businessNum);
                                
                                session.setAttribute("businessNumber",
businessNum);   
                        
                        } else  {
                                
                                Update518page1 updatepg1 = new
Update518page1();
                                statusCode =
updatepg1.upd518pg1(tr518Form,session);
                                
                        }       

                } catch (Exception e) {

                        // Report the error using the appropriate name
and ID.
                        errors.add("name", new ActionError("id"));

                }

                // If a message is required, save the specified key(s)
                // into the request for use by the <struts:errors> tag.

                if (!errors.isEmpty()) {
                        saveErrors(request, errors);
                }
                // Write logic determining how the user should be
forwarded.
                forward = mapping.findForward("next");

                // Finish with
                return (forward);
        }

        public ActionForward save(
            ActionMapping mapping, 
            ActionForm form, 
            HttpServletRequest request, 
            HttpServletResponse response) 
          throws IOException, ServletException { 
        
                String businessNum = null;
                
                ActionErrors errors = new ActionErrors();
                ActionForward forward = new ActionForward();
                // return value
                Tr518Form tr518Form = (Tr518Form) form;
                //String dispatch = tr518Form.getDispatch();
                try {
                        Insert518page1 insertpg1 = new
Insert518page1();
                        businessNum = insertpg1.ins518pg1(tr518Form);
                        
                        System.out.println("businessNumber  : " + 
businessNum);
                        
                        HttpSession session = request.getSession();
                        session.setAttribute("businessNumber",
businessNum);                   
                } catch (Exception e) {
                        // Report the error using the appropriate name
and ID.
                        errors.add("name", new ActionError("id"));
                }
                // If a message is required, save the specified key(s)
                // into the request for use by the <struts:errors> tag.
                if (!errors.isEmpty()) {
                        saveErrors(request, errors);
                }
                // Write logic determining how the user should be
forwarded.
                forward = mapping.findForward("exit");

                // Finish with
                return (forward);
        }

}


Please let me know where I am wrong.

Thanks again so much,
Venkat

>>> "Nagendra Kumar O V S" <[EMAIL PROTECTED]> 08/27/03 11:58AM >>>
hi,
could u post ur action class code . looks like u dont have a method
with the
name error defined in the dispatchaction class.
have u defined the parameter for this action mapping??


-- nagi

-------Original Message-------

From: Venkat Jambulingam
Date: Wednesday, August 27, 2003 09:13:27 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED] 
Subject: Re: Validator and DispatchAction

Hi Nagi,

Here is the error I'm getting while using validator with
DispatchAction:

[ERROR] DispatchAction - -Action[/tr518page1] does not contain method
named error <java.lang.NoSuchMethodException:
error>java.lang.NoSuchMethodException: error
at java.lang.Class.getMethod0(Native Method)
at java.lang.Class.getMethod(Class.java:928)
at
org.apache.struts.actions.DispatchAction.getMethod(DispatchAction.java:334)
at
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction
java:266)
at
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at
org.apache.struts.action.RequestProcessor
processActionPerform(RequestProcessor.java:484)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager
java:827)
at
com.ibm.servlet.engine.webapp.StrictLifecycleServlet
_service(StrictLifecycleServlet.java:167)
at
com.ibm.servlet.engine.webapp.IdleServletState
service(StrictLifecycleServlet.java:297)
at
com.ibm.servlet.engine.webapp.StrictLifecycleServlet
service(StrictLifecycleServlet.java:110)
at
com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager
java:472)
at
com.ibm.servlet.engine.webapp.ValidServletReferenceState
dispatch(ServletManager.java:1012)
at
com.ibm.servlet.engine.webapp.ServletInstanceReference
dispatch(ServletManager.java:913)
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher
handleWebAppDispatch(WebAppRequestDispatcher.java:678)
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher
dispatch(WebAppRequestDispatcher.java:331)
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher
forward(WebAppRequestDispatcher.java:117)
at
com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:134)
at
com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker
java:239)
at
com.ibm.servlet.engine.invocation.CachedInvocation
handleInvocation(CachedInvocation.java:67)
at
com.ibm.servlet.engine.invocation.CacheableInvocationContext
invoke(CacheableInvocationContext.java:106)
at
com.ibm.servlet.engine.srp.ServletRequestProcessor
dispatchByURI(ServletRequestProcessor.java:154)
at
com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener
java:315)
at
com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection
java:60)
at
com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:323)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:252)
at com.ibm.ws.util.CachedThread.run(ThreadPool.java:137)

[8/27/03 11:16:41:759 EDT] 268bd254 WebGroup X SRVE0026E: [Servlet
Error]-[action]: com.ibm.servlet.engine.webapp.WebAppErrorReport:
Action[/tr518page1] does not contain method named error
at
com.ibm.servlet.engine.webapp.WebAppDispatcherResponse
sendError(WebAppDispatcherResponse.java:93)
at
org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction
java:272)
at
org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at
org.apache.struts.action.RequestProcessor
processActionPerform(RequestProcessor.java:484)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager
java:827)
at
com.ibm.servlet.engine.webapp.StrictLifecycleServlet
_service(StrictLifecycleServlet.java:167)
at
com.ibm.servlet.engine.webapp.IdleServletState
service(StrictLifecycleServlet.java:297)
at
com.ibm.servlet.engine.webapp.StrictLifecycleServlet
service(StrictLifecycleServlet.java:110)
at
com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager
java:472)
at
com.ibm.servlet.engine.webapp.ValidServletReferenceState
dispatch(ServletManager.java:1012)
at
com.ibm.servlet.engine.webapp.ServletInstanceReference
dispatch(ServletManager.java:913)
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher
handleWebAppDispatch(WebAppRequestDispatcher.java:678)
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher
dispatch(WebAppRequestDispatcher.java:331)
at
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher
forward(WebAppRequestDispatcher.java:117)
at
com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:134)
at
com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker
java:239)
at
com.ibm.servlet.engine.invocation.CachedInvocation
handleInvocation(CachedInvocation.java:67)
at
com.ibm.servlet.engine.invocation.CacheableInvocationContext
invoke(CacheableInvocationContext.java:106)
at
com.ibm.servlet.engine.srp.ServletRequestProcessor
dispatchByURI(ServletRequestProcessor.java:154)
at
com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener
java:315)
at
com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection
java:60)
at
com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:323)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:252)
at com.ibm.ws.util.CachedThread.run(ThreadPool.java:137)


Below are the details of my application:

I have a wizard form interface. i.e. split a single form into four
pages as given below:

tr518page1.jsp
tr518page2.jsp 
tr518page3.jsp 
tr518page4.jsp

I have four actions corresponding to each jsp page as given below:

Tr518page1Action.java
Tr518page2Action.java
Tr518page3Action.java
Tr518page4Action.java

I have one ActionForm called Tr518Form.java. This form bean contains
the properties for all the four jsp pages.

Below is the struts-config.xml file. ( I have removed unwanted
portions
for clarity )

<struts-config>

<form-beans>
<form-bean name="tr518Form"
type="com.ewd.biztax.forms.Tr518Form"></form-bean>
</form-beans>

<action-mappings>

<action name="tr518Form" input="tr518page1.jsp" path="/tr518page1"
scope="request" parameter="dispatch1"
type="com.ewd.biztax.actions.Tr518page1Action">
<forward name="next" path="/tr518page2.jsp" />
<forward name="exit" path="index.jsp" />
</action>

<action name="tr518Form" input="tr518page2.jsp" path="/tr518page2"
scope="request" parameter="dispatch2"
type="com.ewd.biztax.actions.Tr518page2Action">
<forward name="next" path="/tr518page3.jsp" />
<forward name="exit" path="index.jsp" />
<forward name="previous" path="/tr518page1.jsp" />
</action>

<action name="tr518Form" input="tr518page3.jsp" path="/tr518page3"
scope="request" parameter="dispatch3"
type="com.ewd.biztax.actions.Tr518page3Action">
<forward name="next" path="/tr518page4.jsp" />
<forward name="exit" path="index.jsp" />
<forward name="previous" path="/tr518page2.jsp" />
</action>

<action name="tr518Form" input="tr518page4.jsp" path="/tr518page4"
scope="request" parameter="dispatch4"
type="com.ewd.biztax.actions.Tr518page4Action">
<forward name="next" path="schApage1.jsp" />
<forward name="exit" path="index.jsp" />
<forward name="previous" path="/tr518page3.jsp" />
</action>

</action-mappings>

</struts-config>

Please let me know what is wrong in my application. 

Thank you so much. I really appreciate your kind help in this regard.
Venkat

>>> [EMAIL PROTECTED] 08/27/03 11:05AM >>>
hi
validator has nothing to do with Dispatch action.
paste ur code here if possible to trace ur problem

--nagi

-------Original Message-------

From: Struts Users Mailing List
Date: Wednesday, August 27, 2003 08:00:18 PM
To: [EMAIL PROTECTED] 
Subject: Validator and DispatchAction

Has anybody been successful using validator framework with
DispatchAction? Please let me know. I am getting "NoSuchMethodFound"
error. Please reply.

TIA,
Venkat

---------------------------------------------------------------------
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]

Reply via email to