Validator and DispatchAction
I'm quite new to the validator framework, and was trying to figure out how to use it. My situation is: 1) I want to perform server side validation, and so I made my form extend ValidatorForm; 2) the action that processes my form is a DispatchAction, so I have methods like edit, save list, all associated with the same form; 3) I call http://blabla/myapp/myAction.do?methodName=edit to have the app present me with an empty form; 4) When processing this action, struts allocates the form and calls the validate method, which of course causes validation errors to be produced, and the request to be forwarded to the input element of my action, which, as usual, is the same jsp which contains the form; 5) since the page finds some errors (the form is empty!!) they are shown by the html:errors/ tag. The only think I can imagine is to have a separate action in struts-config, which takes no form and simply redirects control to the jsp page which shows the (html) form. This should avoid Struts from calling the validate method, and hence html:errors/ should show nothing. Of course this would change a bit the logic we already placed in the application actions: for example action.do?methodName=edit in our architecture should present an empty form, while action.do?m=editid=88 should fill the form with the properties of the object with id 88, and then forward to the same jsp page, which then shows that object ready to be modified. If my above consideration is correct I should define two separate actions in struts-config, and let the links be something like newObject.do (for the presentation of an empty form) and unchanged for the loading of an object. Is all this correct ?Are there alternative approaches? Should I quit server side validation and only use client-side (which does not suffer from this problem)? Any help is very appreciated. Renato Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validator and DispatchAction
I ran into the same problem and converted all my DispatchActions to Actions. The downside is that there are more class files, but the mappings seem cleaner, especially in handling the 'input' attribute for html:errors /. Also, using Actions lets me specify different values for the 'validate' attribute. For example, I use the same form to lookup a records as I do to update it. In the case of the lookup, the Action pulls an identifier from the DynaActionForm that doesn't need to be validated (validate=false for this mapping). In the case of the update, full validation of all fields is required, so validate=true for this one. Renato Romano wrote: I'm quite new to the validator framework, and was trying to figure out how to use it. My situation is: 1) I want to perform server side validation, and so I made my form extend ValidatorForm; 2) the action that processes my form is a DispatchAction, so I have methods like edit, save list, all associated with the same form; 3) I call http://blabla/myapp/myAction.do?methodName=edit to have the app present me with an empty form; 4) When processing this action, struts allocates the form and calls the validate method, which of course causes validation errors to be produced, and the request to be forwarded to the input element of my action, which, as usual, is the same jsp which contains the form; 5) since the page finds some errors (the form is empty!!) they are shown by the html:errors/ tag. The only think I can imagine is to have a separate action in struts-config, which takes no form and simply redirects control to the jsp page which shows the (html) form. This should avoid Struts from calling the validate method, and hence html:errors/ should show nothing. Of course this would change a bit the logic we already placed in the application actions: for example action.do?methodName=edit in our architecture should present an empty form, while action.do?m=editid=88 should fill the form with the properties of the object with id 88, and then forward to the same jsp page, which then shows that object ready to be modified. If my above consideration is correct I should define two separate actions in struts-config, and let the links be something like newObject.do (for the presentation of an empty form) and unchanged for the loading of an object. Is all this correct ?Are there alternative approaches? Should I quit server side validation and only use client-side (which does not suffer from this problem)? Any help is very appreciated. Renato Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ - 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]
RE: Validator and DispatchAction
That's just what I supposed. DispatchAction are fine, but when you need finer control Action fits best!! Maybe next time ;-)) Thanks anyway Renato Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ -Original Message- From: Carl Walker [mailto:[EMAIL PROTECTED] Sent: mercoledì 18 febbraio 2004 16.43 To: Struts Users Mailing List Subject: Re: Validator and DispatchAction I ran into the same problem and converted all my DispatchActions to Actions. The downside is that there are more class files, but the mappings seem cleaner, especially in handling the 'input' attribute for html:errors /. Also, using Actions lets me specify different values for the 'validate' attribute. For example, I use the same form to lookup a records as I do to update it. In the case of the lookup, the Action pulls an identifier from the DynaActionForm that doesn't need to be validated (validate=false for this mapping). In the case of the update, full validation of all fields is required, so validate=true for this one. Renato Romano wrote: I'm quite new to the validator framework, and was trying to figure out how to use it. My situation is: 1) I want to perform server side validation, and so I made my form extend ValidatorForm; 2) the action that processes my form is a DispatchAction, so I have methods like edit, save list, all associated with the same form; 3) I call http://blabla/myapp/myAction.do?methodName=edit to have the app present me with an empty form; 4) When processing this action, struts allocates the form and calls the validate method, which of course causes validation errors to be produced, and the request to be forwarded to the input element of my action, which, as usual, is the same jsp which contains the form; 5) since the page finds some errors (the form is empty!!) they are shown by the html:errors/ tag. The only think I can imagine is to have a separate action in struts-config, which takes no form and simply redirects control to the jsp page which shows the (html) form. This should avoid Struts from calling the validate method, and hence html:errors/ should show nothing. Of course this would change a bit the logic we already placed in the application actions: for example action.do?methodName=edit in our architecture should present an empty form, while action.do?m=editid=88 should fill the form with the properties of the object with id 88, and then forward to the same jsp page, which then shows that object ready to be modified. If my above consideration is correct I should define two separate actions in struts-config, and let the links be something like newObject.do (for the presentation of an empty form) and unchanged for the loading of an object. Is all this correct ?Are there alternative approaches? Should I quit server side validation and only use client-side (which does not suffer from this problem)? Any help is very appreciated. Renato Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ - 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]
RE: Validator and DispatchAction
Set validate=false in your action mapping in struts-config. This tells the struts framework not to call validate. Then in your action class you can call validate where appropriate, i.e., the *save* method. -Original Message- From: Renato Romano [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 18, 2004 6:43 AM To: 'Struts Users Mailing List' Subject: Validator and DispatchAction I'm quite new to the validator framework, and was trying to figure out how to use it. My situation is: 1) I want to perform server side validation, and so I made my form extend ValidatorForm; 2) the action that processes my form is a DispatchAction, so I have methods like edit, save list, all associated with the same form; 3) I call http://blabla/myapp/myAction.do?methodName=edit to have the app present me with an empty form; 4) When processing this action, struts allocates the form and calls the validate method, which of course causes validation errors to be produced, and the request to be forwarded to the input element of my action, which, as usual, is the same jsp which contains the form; 5) since the page finds some errors (the form is empty!!) they are shown by the html:errors/ tag. The only think I can imagine is to have a separate action in struts-config, which takes no form and simply redirects control to the jsp page which shows the (html) form. This should avoid Struts from calling the validate method, and hence html:errors/ should show nothing. Of course this would change a bit the logic we already placed in the application actions: for example action.do?methodName=edit in our architecture should present an empty form, while action.do?m=editid=88 should fill the form with the properties of the object with id 88, and then forward to the same jsp page, which then shows that object ready to be modified. If my above consideration is correct I should define two separate actions in struts-config, and let the links be something like newObject.do (for the presentation of an empty form) and unchanged for the loading of an object. Is all this correct ?Are there alternative approaches? Should I quit server side validation and only use client-side (which does not suffer from this problem)? Any help is very appreciated. Renato Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ - 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]
RE: Validator and DispatchAction
Renato, There is another solution that is clean. We use one action class with multiple (3) mappings to support our validation needs. With our editor scheme, the user proceeds to a Top page where they decide to Edit an existing or Add a new item. They then proceed to a Detail page where they build the item. The validations for the Top and Detail pages are different, and we use the same form for both. We want our server side validation failures to return to the page that caused the failure. For the Top page, that is not an issue, since there is only one possible page that could have caused the validation issue. We had to address the Edit and Add pages. For this, we have three mappings: Top - Handles initial requests for the Top page and actions from the Top page. In this case, the input attribute always returns to the same page. This mapping uses Top validations. Detail - Handles requests that originate from a detail page. This mapping uses Detail validations. In this case, the input attribute always points to the third mapping: ValidationFailure. We additionally add a new attribute that points to a specialized method in the action class. ValidationFailure - Handles requests where the detail validation failed. Uses a different parameter for the DispatchAction than the other two methods. Validation is set to false. The available forwards are the same as the Edit and Add forwards that are found in the Top mapping. When the failure method is used, it takes care of any prep work that is needed to return to the detail page. For example, there are some DB values that we put into the request (they should be in the session, but that's another story) when we go to the page. The failure method handles any of the necessary prep work. The last task is that we retrieve the parameter that was used for the original DispatchAction and return the mapping that will take us back to the page that caused the error. In our case, we use LookupDispatchAction classes, and this works well and is pretty neat. Additionally, all of our action classes extend a custom LookupDispatchAction class that implements the failure method as well as a few other things that are generic for all of action classes. Let me know if this helps. Nick |-+ | | Renato Romano | | | [EMAIL PROTECTED]| | | work.com| | || | | 02/18/2004 11:18 | | | AM | | | Please respond to| | | Struts Users| | | Mailing List| | || |-+ --| | | | To: 'Struts Users Mailing List' [EMAIL PROTECTED] | | cc: | | Subject: RE: Validator and DispatchAction | --| That's just what I supposed. DispatchAction are fine, but when you need finer control Action fits best!! Maybe next time ;-)) Thanks anyway Renato Renato Romano Sistemi e Telematica S.p.A. Calata Grazie - Vial Al Molo Giano 16127 - GENOVA e-mail: [EMAIL PROTECTED] Tel.: 010 2712603 _ -Original Message- From: Carl Walker [mailto:[EMAIL PROTECTED] Sent: mercoledì 18 febbraio 2004 16.43 To: Struts Users Mailing List Subject: Re: Validator and DispatchAction I ran into the same problem and converted all my DispatchActions to Actions. The downside is that there are more class files, but the mappings seem cleaner, especially in handling the 'input' attribute for html:errors /. Also, using Actions lets me specify different values for the 'validate' attribute. For example, I use the same form to lookup a records as I do to update it. In the case of the lookup, the Action pulls an identifier from the DynaActionForm that doesn't need to be validated (validate=false for this mapping). In the case of the update, full validation of all fields is required, so validate=true for this one. Renato Romano wrote: I'm quite new to the validator framework, and was trying to figure out how to use it. My situation is: 1) I want to perform server side validation, and so I made my form extend ValidatorForm; 2) the action that processes my form is a DispatchAction, so
RE: Validator and DispatchAction
Ok, I see one potential problem. Your methods are declared as throwing ServletException and IOException, but for Struts 1.1 they should be declared as throwing Exception. public ActionForward create( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ... should be throws Exception { Try changing that and see how you get on. Steve http://www.ninsky.com/struts/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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]
Re: Validator and DispatchAction
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 withDispatchAction? 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]. IncrediMail - Email has finally evolved - Click Here
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: errorjava.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
Re: Validator and DispatchAction
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
RE: Validator and DispatchAction
This is the relevant part of the message: Action[/tr518page1] does not contain method named error Does your DispatchAction class, com.ewd.biztax.actions.Tr518page1Action, contain a method named error? Steve http://www.ninsky.com/struts/ -Original Message- From: Venkat Jambulingam [mailto:[EMAIL PROTECTED] Sent: August 27, 2003 8:43 AM 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: errorjava.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(DispatchAc tion.java:266) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216) at org.apache.struts.action.RequestProcessor.processActionPerform(Req uestProcessor.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(Serv letManager.java:827) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(Stri ctLifecycleServlet.java:167) at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifec ycleServlet.java:297) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(Stric tLifecycleServlet.java:110) at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManag er.java:472) at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch( ServletManager.java:1012) at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(Se rvletManager.java:913) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebApp Dispatch(WebAppRequestDispatcher.java:678) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(Web AppRequestDispatcher.java:331) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebA ppRequestDispatcher.java:117) at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:134) at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebA ppInvoker.java:239) at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocatio n(CachedInvocation.java:67) at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invok e(CacheableInvocationContext.java:106) at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(S ervletRequestProcessor.java:154) at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(O SEListener.java:315) at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpCon nection.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(W ebAppDispatcherResponse.java:93) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAc tion.java:272) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216) at org.apache.struts.action.RequestProcessor.processActionPerform(Req uestProcessor.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(Serv letManager.java:827) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(Stri ctLifecycleServlet.java:167) at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifec ycleServlet.java:297) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(Stric tLifecycleServlet.java:110
RE: Validator and DispatchAction
Isn't it weird that there is no name for the action: ...DispatchAction --Action[/... [ERROR] DispatchAction - -Action[/tr518page1] does not contain method named error java.lang.NoSuchMethodException: errorjava.lang.NoSuchMethodException: error -Original Message- From: Steve Raeburn [mailto:[EMAIL PROTECTED] Sent: August 27, 2003 10:05 AM To: Struts Users Mailing List Subject: RE: Validator and DispatchAction This is the relevant part of the message: Action[/tr518page1] does not contain method named error Does your DispatchAction class, com.ewd.biztax.actions.Tr518page1Action, contain a method named error? Steve http://www.ninsky.com/struts/ -Original Message- From: Venkat Jambulingam [mailto:[EMAIL PROTECTED] Sent: August 27, 2003 8:43 AM 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: errorjava.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(DispatchAc tion.java:266) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216) at org.apache.struts.action.RequestProcessor.processActionPerform(Req uestProcessor.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(Serv letManager.java:827) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(Stri ctLifecycleServlet.java:167) at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifec ycleServlet.java:297) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(Stric tLifecycleServlet.java:110) at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManag er.java:472) at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch( ServletManager.java:1012) at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(Se rvletManager.java:913) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebApp Dispatch(WebAppRequestDispatcher.java:678) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(Web AppRequestDispatcher.java:331) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebA ppRequestDispatcher.java:117) at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:134) at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebA ppInvoker.java:239) at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocatio n(CachedInvocation.java:67) at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invok e(CacheableInvocationContext.java:106) at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(S ervletRequestProcessor.java:154) at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(O SEListener.java:315) at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpCon nection.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(W ebAppDispatcherResponse.java:93) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAc tion.java:272) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216) at org.apache.struts.action.RequestProcessor.processActionPerform(Req uestProcessor.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
Re: Validator and DispatchAction
oops.. I did not understand your question about defining parameter for the action mapping. In my struts-config.xml, I have defined the parameters for the actions as given below: 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 Please let me know if this is the parameter you are talking about. Thanks in Advance, 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: errorjava.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
RE: Validator and DispatchAction
Hi Steve, I don't have a method named error in my action class. I don't need one. Why is it looking for such a method in my action class? Help me please. I have to decide soon whether to go with validator framework or not. Thank you very much, Venkat [EMAIL PROTECTED] 08/27/03 12:05PM This is the relevant part of the message: Action[/tr518page1] does not contain method named error Does your DispatchAction class, com.ewd.biztax.actions.Tr518page1Action, contain a method named error? Steve http://www.ninsky.com/struts/ -Original Message- From: Venkat Jambulingam [mailto:[EMAIL PROTECTED] Sent: August 27, 2003 8:43 AM 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: errorjava.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(DispatchAc tion.java:266) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216) at org.apache.struts.action.RequestProcessor.processActionPerform(Req uestProcessor.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(Serv letManager.java:827) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(Stri ctLifecycleServlet.java:167) at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifec ycleServlet.java:297) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(Stric tLifecycleServlet.java:110) at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManag er.java:472) at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch( ServletManager.java:1012) at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(Se rvletManager.java:913) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebApp Dispatch(WebAppRequestDispatcher.java:678) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(Web AppRequestDispatcher.java:331) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebA ppRequestDispatcher.java:117) at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:134) at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebA ppInvoker.java:239) at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocatio n(CachedInvocation.java:67) at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invok e(CacheableInvocationContext.java:106) at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(S ervletRequestProcessor.java:154) at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(O SEListener.java:315) at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpCon nection.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(W ebAppDispatcherResponse.java:93) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAc tion.java:272) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216) at org.apache.struts.action.RequestProcessor.processActionPerform(Req uestProcessor.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(Serv letManager.java:827
RE: Validator and DispatchAction
The error message you are receiving indicates that DispatchAction is trying to find a method named 'error' in your class and it can't find one. There's really only two reasons that could be: 1. There should be a method named 'error' and there isn't one. 2. There isn't supposed to be one but somehow you are attempting to call it with a URL like this: http://localhost:8080/myapp/tr518page1.do?dispatch1=error Are you dynamically generating the URL? If so, that might be the problem if it is generating an error returning a string like error=. For what it's worth, I copied your code and it dispatches perfectly well here. (BTW my previous message about Exceptions was a red herring. Although you should be throwing Exception, I tried it as you had written and it works.) Steve http://www.ninsky.com/struts/ -Original Message- From: Venkat Jambulingam [mailto:[EMAIL PROTECTED] Sent: August 27, 2003 9:58 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Validator and DispatchAction Hi Steve, I don't have a method named error in my action class. I don't need one. Why is it looking for such a method in my action class? Help me please. I have to decide soon whether to go with validator framework or not. Thank you very much, Venkat [EMAIL PROTECTED] 08/27/03 12:05PM This is the relevant part of the message: Action[/tr518page1] does not contain method named error Does your DispatchAction class, com.ewd.biztax.actions.Tr518page1Action, contain a method named error? Steve http://www.ninsky.com/struts/ -Original Message- From: Venkat Jambulingam [mailto:[EMAIL PROTECTED] Sent: August 27, 2003 8:43 AM 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: errorjava.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(DispatchAc tion.java:266) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216) at org.apache.struts.action.RequestProcessor.processActionPerform(Req uestProcessor.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(Serv letManager.java:827) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(Stri ctLifecycleServlet.java:167) at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifec ycleServlet.java:297) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(Stric tLifecycleServlet.java:110) at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManag er.java:472) at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch( ServletManager.java:1012) at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(Se rvletManager.java:913) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebApp Dispatch(WebAppRequestDispatcher.java:678) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(Web AppRequestDispatcher.java:331) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebA ppRequestDispatcher.java:117) at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:134) at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebA ppInvoker.java:239) at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocatio n(CachedInvocation.java:67) at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invok e(CacheableInvocationContext.java:106) at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(S ervletRequestProcessor.java:154) at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(O SEListener.java:315) at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpCon nection.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
RE: Validator and DispatchAction
It works now... Thank you for all the help. [EMAIL PROTECTED] 08/27/03 12:58PM Hi Steve, I don't have a method named error in my action class. I don't need one. Why is it looking for such a method in my action class? Help me please. I have to decide soon whether to go with validator framework or not. Thank you very much, Venkat [EMAIL PROTECTED] 08/27/03 12:05PM This is the relevant part of the message: Action[/tr518page1] does not contain method named error Does your DispatchAction class, com.ewd.biztax.actions.Tr518page1Action, contain a method named error? Steve http://www.ninsky.com/struts/ -Original Message- From: Venkat Jambulingam [mailto:[EMAIL PROTECTED] Sent: August 27, 2003 8:43 AM 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: errorjava.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(DispatchAc tion.java:266) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216) at org.apache.struts.action.RequestProcessor.processActionPerform(Req uestProcessor.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(Serv letManager.java:827) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(Stri ctLifecycleServlet.java:167) at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifec ycleServlet.java:297) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(Stric tLifecycleServlet.java:110) at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManag er.java:472) at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch( ServletManager.java:1012) at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(Se rvletManager.java:913) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebApp Dispatch(WebAppRequestDispatcher.java:678) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(Web AppRequestDispatcher.java:331) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebA ppRequestDispatcher.java:117) at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:134) at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebA ppInvoker.java:239) at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocatio n(CachedInvocation.java:67) at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invok e(CacheableInvocationContext.java:106) at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(S ervletRequestProcessor.java:154) at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(O SEListener.java:315) at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpCon nection.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(W ebAppDispatcherResponse.java:93) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAc tion.java:272) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216) at org.apache.struts.action.RequestProcessor.processActionPerform(Req uestProcessor.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
RE: Validator and DispatchAction
It works now. Thank you everyone for helping me. [EMAIL PROTECTED] 08/27/03 12:58PM Hi Steve, I don't have a method named error in my action class. I don't need one. Why is it looking for such a method in my action class? Help me please. I have to decide soon whether to go with validator framework or not. Thank you very much, Venkat [EMAIL PROTECTED] 08/27/03 12:05PM This is the relevant part of the message: Action[/tr518page1] does not contain method named error Does your DispatchAction class, com.ewd.biztax.actions.Tr518page1Action, contain a method named error? Steve http://www.ninsky.com/struts/ -Original Message- From: Venkat Jambulingam [mailto:[EMAIL PROTECTED] Sent: August 27, 2003 8:43 AM 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: errorjava.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(DispatchAc tion.java:266) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216) at org.apache.struts.action.RequestProcessor.processActionPerform(Req uestProcessor.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(Serv letManager.java:827) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(Stri ctLifecycleServlet.java:167) at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifec ycleServlet.java:297) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(Stric tLifecycleServlet.java:110) at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManag er.java:472) at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch( ServletManager.java:1012) at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(Se rvletManager.java:913) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebApp Dispatch(WebAppRequestDispatcher.java:678) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(Web AppRequestDispatcher.java:331) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebA ppRequestDispatcher.java:117) at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:134) at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebA ppInvoker.java:239) at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocatio n(CachedInvocation.java:67) at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invok e(CacheableInvocationContext.java:106) at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(S ervletRequestProcessor.java:154) at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(O SEListener.java:315) at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpCon nection.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(W ebAppDispatcherResponse.java:93) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAc tion.java:272) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216) at org.apache.struts.action.RequestProcessor.processActionPerform(Req uestProcessor.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
RE: Validator and DispatchAction
Hi Steve, I just saw your message now. You are correct. I disabled javascript which is used to set the value of dispatch1 to something other than the default value (errror). Your insight really helped me pinpoint the bug. Thank you so much. I was about to drop the idea of using validators... Thank you for all your time and effort. Venkat [EMAIL PROTECTED] 08/27/03 01:42PM The error message you are receiving indicates that DispatchAction is trying to find a method named 'error' in your class and it can't find one. There's really only two reasons that could be: 1. There should be a method named 'error' and there isn't one. 2. There isn't supposed to be one but somehow you are attempting to call it with a URL like this: http://localhost:8080/myapp/tr518page1.do?dispatch1=error Are you dynamically generating the URL? If so, that might be the problem if it is generating an error returning a string like error=. For what it's worth, I copied your code and it dispatches perfectly well here. (BTW my previous message about Exceptions was a red herring. Although you should be throwing Exception, I tried it as you had written and it works.) Steve http://www.ninsky.com/struts/ -Original Message- From: Venkat Jambulingam [mailto:[EMAIL PROTECTED] Sent: August 27, 2003 9:58 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Validator and DispatchAction Hi Steve, I don't have a method named error in my action class. I don't need one. Why is it looking for such a method in my action class? Help me please. I have to decide soon whether to go with validator framework or not. Thank you very much, Venkat [EMAIL PROTECTED] 08/27/03 12:05PM This is the relevant part of the message: Action[/tr518page1] does not contain method named error Does your DispatchAction class, com.ewd.biztax.actions.Tr518page1Action, contain a method named error? Steve http://www.ninsky.com/struts/ -Original Message- From: Venkat Jambulingam [mailto:[EMAIL PROTECTED] Sent: August 27, 2003 8:43 AM 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: errorjava.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(DispatchAc tion.java:266) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216) at org.apache.struts.action.RequestProcessor.processActionPerform(Req uestProcessor.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(Serv letManager.java:827) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(Stri ctLifecycleServlet.java:167) at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifec ycleServlet.java:297) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(Stric tLifecycleServlet.java:110) at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManag er.java:472) at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch( ServletManager.java:1012) at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(Se rvletManager.java:913) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebApp Dispatch(WebAppRequestDispatcher.java:678) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(Web AppRequestDispatcher.java:331) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebA ppRequestDispatcher.java:117) at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:134) at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebA ppInvoker.java:239) at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocatio n(CachedInvocation.java:67) at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invok e(CacheableInvocationContext.java:106) at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(S ervletRequestProcessor.java:154) at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(O SEListener.java:315
RE: Validator and DispatchAction
Venkat, What was the solution? -R -Original Message- From: Venkat Jambulingam [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 27, 2003 11:06 AM To: [EMAIL PROTECTED] Subject: RE: Validator and DispatchAction It works now. Thank you everyone for helping me. [EMAIL PROTECTED] 08/27/03 12:58PM Hi Steve, I don't have a method named error in my action class. I don't need one. Why is it looking for such a method in my action class? Help me please. I have to decide soon whether to go with validator framework or not. Thank you very much, Venkat [EMAIL PROTECTED] 08/27/03 12:05PM This is the relevant part of the message: Action[/tr518page1] does not contain method named error Does your DispatchAction class, com.ewd.biztax.actions.Tr518page1Action, contain a method named error? Steve http://www.ninsky.com/struts/ -Original Message- From: Venkat Jambulingam [mailto:[EMAIL PROTECTED] Sent: August 27, 2003 8:43 AM 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: errorjava.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(DispatchAc tion.java:266) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216) at org.apache.struts.action.RequestProcessor.processActionPerform(Req uestProcessor.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(Serv letManager.java:827) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(Stri ctLifecycleServlet.java:167) at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifec ycleServlet.java:297) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(Stric tLifecycleServlet.java:110) at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManag er.java:472) at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch( ServletManager.java:1012) at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(Se rvletManager.java:913) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebApp Dispatch(WebAppRequestDispatcher.java:678) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(Web AppRequestDispatcher.java:331) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebA ppRequestDispatcher.java:117) at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:134) at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebA ppInvoker.java:239) at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocatio n(CachedInvocation.java:67) at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invok e(CacheableInvocationContext.java:106) at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(S ervletRequestProcessor.java:154) at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(O SEListener.java:315) at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpCon nection.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(W ebAppDispatcherResponse.java:93) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAc tion.java:272) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216) at org.apache.struts.action.RequestProcessor.processActionPerform(Req uestProcessor.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
RE: Validator and DispatchAction
The solution is to use LookupDispatchAction instead of DispatchAction as the former does not depend on javascript. The problem: I had three buttons on my page save, next and previous. When a user clicks a button, I set a variable called dispatch to corresponsing value using javascript. For save button, dispatch will be set to save and so on. I use javascript to do this. The DispatchAction would call the corresponding method based on the value of dispatch variable. The problem started when I disabled javascript. By default the dipatch was set to error value. Since I did not have a method named error in my DispatchAction, I was getting methodnotfoundexception. HTH, Venkat [EMAIL PROTECTED] 08/27/03 02:14PM Venkat, What was the solution? -R -Original Message- From: Venkat Jambulingam [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 27, 2003 11:06 AM To: [EMAIL PROTECTED] Subject: RE: Validator and DispatchAction It works now. Thank you everyone for helping me. [EMAIL PROTECTED] 08/27/03 12:58PM Hi Steve, I don't have a method named error in my action class. I don't need one. Why is it looking for such a method in my action class? Help me please. I have to decide soon whether to go with validator framework or not. Thank you very much, Venkat [EMAIL PROTECTED] 08/27/03 12:05PM This is the relevant part of the message: Action[/tr518page1] does not contain method named error Does your DispatchAction class, com.ewd.biztax.actions.Tr518page1Action, contain a method named error? Steve http://www.ninsky.com/struts/ -Original Message- From: Venkat Jambulingam [mailto:[EMAIL PROTECTED] Sent: August 27, 2003 8:43 AM 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: errorjava.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(DispatchAc tion.java:266) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216) at org.apache.struts.action.RequestProcessor.processActionPerform(Req uestProcessor.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(Serv letManager.java:827) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(Stri ctLifecycleServlet.java:167) at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifec ycleServlet.java:297) at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(Stric tLifecycleServlet.java:110) at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManag er.java:472) at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch( ServletManager.java:1012) at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(Se rvletManager.java:913) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebApp Dispatch(WebAppRequestDispatcher.java:678) at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(Web AppRequestDispatcher.java:331) at com.ib m.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebA ppRequestDispatcher.java:117) at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:134) at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebA ppInvoker.java:239) at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocatio n(CachedInvocation.java:67) at com.ibm.servlet.engine.invocation.CacheableInvocationContext.invok e(CacheableInvocationContext.java:106) at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(S ervletRequestProcessor.java:154) at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(O SEListener.java:315) at com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpCon nection.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
using validator with DispatchAction
Hi, i dont know how to use the Struts validator together with DispatchAction (Struts 1.1b1): in the validator.xml there had to be the - name of the form of struts-config (f. e. TestForm) - or the name of the path from struts-config (f.e. /test ) as soon as one of this appears, the validation gets started. If i only want to start validation with (/test?method=specialThing), i couldnt define it anywhere, as far as i see. So, the validation is started for e. g.: - /test?method=showLeftFrame - /test?method=showMainFrame - /test?method=specialThing therefore always the jsp, which is defined as input in struts-config is shown. Suppose i have a Frameset with two frames, in both frames are shown the same jsp now. Who knows a solution? Or do i have to extend Struts myself? Best Regards, M. Weise
Re: Validator and DispatchAction
My solution : I did a class MyValidator with two methods (verifyMethod and validateRequired) --- private static boolean verifyMethod( Object bean, ValidatorAction va, Field field, ActionErrors errors, HttpServletRequest request) { String methodRequest = request.getParameter(method); String methodsToValidate = field.getVarValue(method); boolean validate = false; if ((methodsToValidate != null) (methodsToValidate.length() 0)) { if (methodRequest != null) { if (methodsToValidate != null) { StringTokenizer st = new StringTokenizer(methodsToValidate, ,); String method = ; while (st.hasMoreElements()) { method = (String) st.nextToken(); if (method.equals(methodRequest)) { validate = true; break; } } } } } return validate; } public static boolean validateRequired( Object bean, ValidatorAction va, Field field, ActionErrors errors, HttpServletRequest request) { if (verifyMethod(bean,va,field,errors,request)) return StrutsValidator.validateRequired(bean,va,field,errors,request); else return false; } -- In the file validaion-rules.xml I changed the validator required like this: validator name=required classname=MyValidator method=validateRequired ... /validator Now , I can configure in the validator.xml the methods that I want to validate. For example : form name=logonForm fieldproperty=userId depends=required arg0 key=logonForm.email.displayname/ var var-namemethod/var-name var-valueupdate,delete/var-value /var /field /form David, What do you think about this solution ? Thanks, William. _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Validator and DispatchAction
I think that is good. This along the lines of what I was thinking. David --- William W [EMAIL PROTECTED] wrote: My solution : I did a class MyValidator with two methods (verifyMethod and validateRequired) --- private static boolean verifyMethod( Object bean, ValidatorAction va, Field field, ActionErrors errors, HttpServletRequest request) { String methodRequest = request.getParameter(method); String methodsToValidate = field.getVarValue(method); boolean validate = false; if ((methodsToValidate != null) (methodsToValidate.length() 0)) { if (methodRequest != null) { if (methodsToValidate != null) { StringTokenizer st = new StringTokenizer(methodsToValidate, ,); String method = ; while (st.hasMoreElements()) { method = (String) st.nextToken(); if (method.equals(methodRequest)) { validate = true; break; } } } } } return validate; } public static boolean validateRequired( Object bean, ValidatorAction va, Field field, ActionErrors errors, HttpServletRequest request) { if (verifyMethod(bean,va,field,errors,request)) return StrutsValidator.validateRequired(bean,va,field,errors,request); else return false; } -- In the file validaion-rules.xml I changed the validator required like this: validator name=required classname=MyValidator method=validateRequired ... /validator Now , I can configure in the validator.xml the methods that I want to validate. For example : form name=logonForm fieldproperty=userId depends=required arg0 key=logonForm.email.displayname/ var var-namemethod/var-name var-valueupdate,delete/var-value /var /field /form David, What do you think about this solution ? Thanks, William. _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Validator and DispatchAction
I think that if I use DispatchAction with ValidatorActionForm I will have the same problem. How can I validate the form for diferents methods in the same Action ? Am I wrong ? Thanks, William. From: David Winterfeldt [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED], Rick Reumann [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Wed, 12 Jun 2002 14:42:51 -0700 (PDT) You would currently have to write your own required validation method and have it check a variable defined by a field to see if it should perform the validation or not. Or define a separate set of validation rules for each action and use ValidatorActionForm (which uses the action path to retrieve the validation rules). David --- Rick Reumann [EMAIL PROTECTED] wrote: On Wednesday, June 12, 2002, 10:14:09 AM, William wrote: WW I have a UserForm, the fields are : userId and userName. WW I have a UserAction that extends DispatchAction. The UserAction have two WW methods (insert and update). For the insert method only the userName is WW required, and for update method the userId and the userName are required. WW How can I can do a dependency validation with the validator.xml ? I'm curious about this as well. There was a post a few days back dealing with the same issue. I think you are able to nest validation rules for a form but I forgot the exact syntax. Maybe someone else could shed some light again on how to do this. -- Rick mailto:[EMAIL PROTECTED] If you go to a party, and you want to be the popular one at the party, do this: Wait until no one is looking, then kick a burning log out of the fireplace onto the carpet. Then jump on top of it with your body and yell, Log o' fire! Log o' fire! I've never done this, but I think it'd work. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Validator and DispatchAction
DispatchAction has a lot of things to improve on...use of declarative exceptions is one...then there's this issue you brought up about the validator...you may have to do programmatic validation to provide different validation rules for each method in the DispatchAction for now.. - William W [EMAIL PROTECTED] on 06/13/2002 07:46:09 AM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc: Subject: Re: Validator and DispatchAction I think that if I use DispatchAction with ValidatorActionForm I will have the same problem. How can I validate the form for diferents methods in the same Action ? Am I wrong ? Thanks, William. From: David Winterfeldt [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED], Rick Reumann [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Wed, 12 Jun 2002 14:42:51 -0700 (PDT) You would currently have to write your own required validation method and have it check a variable defined by a field to see if it should perform the validation or not. Or define a separate set of validation rules for each action and use ValidatorActionForm (which uses the action path to retrieve the validation rules). David --- Rick Reumann [EMAIL PROTECTED] wrote: On Wednesday, June 12, 2002, 10:14:09 AM, William wrote: WW I have a UserForm, the fields are : userId and userName. WW I have a UserAction that extends DispatchAction. The UserAction have two WW methods (insert and update). For the insert method only the userName is WW required, and for update method the userId and the userName are required. WW How can I can do a dependency validation with the validator.xml ? I'm curious about this as well. There was a post a few days back dealing with the same issue. I think you are able to nest validation rules for a form but I forgot the exact syntax. Maybe someone else could shed some light again on how to do this. -- Rick mailto:[EMAIL PROTECTED] If you go to a party, and you want to be the popular one at the party, do this: Wait until no one is looking, then kick a burning log out of the fireplace onto the carpet. Then jump on top of it with your body and yell, Log o' fire! Log o' fire! I've never done this, but I think it'd work. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] ** Please Note: The information in this E-mail message, and any files transmitted with it, is confidential and may be legally privileged. It is intended only for the use of the individual(s) named above. If you are the intended recipient, be aware that your use of any confidential or personal information may be restricted by state and federal privacy laws. If you, the reader of this message, are not the intended recipient, you are hereby notified that you should not further disseminate, distribute, or forward this E-mail message. If you have received this E-mail in error, please notify the sender and delete the material from any computer. Thank you. ** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Validator and DispatchAction
Is it possible ? Use boolean in the depends property ? field property=password depends=method OR required arg0 key=typeForm.password.displayname/ var var-namemethodName/var-name var-valueupdate/var-value /var /field From: William W [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Thu, 13 Jun 2002 14:46:09 + I think that if I use DispatchAction with ValidatorActionForm I will have the same problem. How can I validate the form for diferents methods in the same Action ? Am I wrong ? Thanks, William. From: David Winterfeldt [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED], Rick Reumann [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Wed, 12 Jun 2002 14:42:51 -0700 (PDT) You would currently have to write your own required validation method and have it check a variable defined by a field to see if it should perform the validation or not. Or define a separate set of validation rules for each action and use ValidatorActionForm (which uses the action path to retrieve the validation rules). David --- Rick Reumann [EMAIL PROTECTED] wrote: On Wednesday, June 12, 2002, 10:14:09 AM, William wrote: WW I have a UserForm, the fields are : userId and userName. WW I have a UserAction that extends DispatchAction. The UserAction have two WW methods (insert and update). For the insert method only the userName is WW required, and for update method the userId and the userName are required. WW How can I can do a dependency validation with the validator.xml ? I'm curious about this as well. There was a post a few days back dealing with the same issue. I think you are able to nest validation rules for a form but I forgot the exact syntax. Maybe someone else could shed some light again on how to do this. -- Rick mailto:[EMAIL PROTECTED] If you go to a party, and you want to be the popular one at the party, do this: Wait until no one is looking, then kick a burning log out of the fireplace onto the carpet. Then jump on top of it with your body and yell, Log o' fire! Log o' fire! I've never done this, but I think it'd work. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Validator and DispatchAction
You can't use booleans in the depends, but there can be dependencies setup between validation routines. You can make a method check pluggable validator and have required and other validator depend on it. Although the default configuration has everything depend on required so if required depends on something else, everything should work fine. Method would be checked first and then if it passes required would be next. validator name=method classname=MyDispatchMethodChecker method=validateDispatchMethod methodParams=java.lang.Object,org.apache.commons.validator.ValidatorAction,org.apache.commons.validator.Field,org.apache.struts.action.ActionErrors,javax.servlet.http.HttpServletRequest msg=errors.method/ validator name=required classname=org.apache.struts.util.StrutsValidator method=validateRequired methodParams=java.lang.Object,org.apache.commons.validator.ValidatorAction,org.apache.commons.validator.Field,org.apache.struts.action.ActionErrors,javax.servlet.http.HttpServletRequest depends=method msg=errors.required/ David --- William W [EMAIL PROTECTED] wrote: Is it possible ? Use boolean in the depends property ? field property=password depends=method OR required arg0 key=typeForm.password.displayname/ var var-namemethodName/var-name var-valueupdate/var-value /var /field From: William W [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Thu, 13 Jun 2002 14:46:09 + I think that if I use DispatchAction with ValidatorActionForm I will have the same problem. How can I validate the form for diferents methods in the same Action ? Am I wrong ? Thanks, William. From: David Winterfeldt [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED], Rick Reumann [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Wed, 12 Jun 2002 14:42:51 -0700 (PDT) You would currently have to write your own required validation method and have it check a variable defined by a field to see if it should perform the validation or not. Or define a separate set of validation rules for each action and use ValidatorActionForm (which uses the action path to retrieve the validation rules). David --- Rick Reumann [EMAIL PROTECTED] wrote: On Wednesday, June 12, 2002, 10:14:09 AM, William wrote: WW I have a UserForm, the fields are : userId and userName. WW I have a UserAction that extends DispatchAction. The UserAction have two WW methods (insert and update). For the insert method only the userName is WW required, and for update method the userId and the userName are required. WW How can I can do a dependency validation with the validator.xml ? I'm curious about this as well. There was a post a few days back dealing with the same issue. I think you are able to nest validation rules for a form but I forgot the exact syntax. Maybe someone else could shed some light again on how to do this. -- Rick mailto:[EMAIL PROTECTED] If you go to a party, and you want to be the popular one at the party, do this: Wait until no one is looking, then kick a burning log out of the fireplace onto the carpet. Then jump on top of it with your body and yell, Log o' fire! Log o' fire! I've never done this, but I think it'd work. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Validator and DispatchAction
Good :) I will try !!! Thanks ! WIlliam. From: David Winterfeldt [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Thu, 13 Jun 2002 09:04:56 -0700 (PDT) You can't use booleans in the depends, but there can be dependencies setup between validation routines. You can make a method check pluggable validator and have required and other validator depend on it. Although the default configuration has everything depend on required so if required depends on something else, everything should work fine. Method would be checked first and then if it passes required would be next. validator name=method classname=MyDispatchMethodChecker method=validateDispatchMethod methodParams=java.lang.Object,org.apache.commons.validator.ValidatorAction,org.apache.commons.validator.Field,org.apache.struts.action.ActionErrors,javax.servlet.http.HttpServletRequest msg=errors.method/ validator name=required classname=org.apache.struts.util.StrutsValidator method=validateRequired methodParams=java.lang.Object,org.apache.commons.validator.ValidatorAction,org.apache.commons.validator.Field,org.apache.struts.action.ActionErrors,javax.servlet.http.HttpServletRequest depends=method msg=errors.required/ David --- William W [EMAIL PROTECTED] wrote: Is it possible ? Use boolean in the depends property ? field property=password depends=method OR required arg0 key=typeForm.password.displayname/ var var-namemethodName/var-name var-valueupdate/var-value /var /field From: William W [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Thu, 13 Jun 2002 14:46:09 + I think that if I use DispatchAction with ValidatorActionForm I will have the same problem. How can I validate the form for diferents methods in the same Action ? Am I wrong ? Thanks, William. From: David Winterfeldt [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED], Rick Reumann [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Wed, 12 Jun 2002 14:42:51 -0700 (PDT) You would currently have to write your own required validation method and have it check a variable defined by a field to see if it should perform the validation or not. Or define a separate set of validation rules for each action and use ValidatorActionForm (which uses the action path to retrieve the validation rules). David --- Rick Reumann [EMAIL PROTECTED] wrote: On Wednesday, June 12, 2002, 10:14:09 AM, William wrote: WW I have a UserForm, the fields are : userId and userName. WW I have a UserAction that extends DispatchAction. The UserAction have two WW methods (insert and update). For the insert method only the userName is WW required, and for update method the userId and the userName are required. WW How can I can do a dependency validation with the validator.xml ? I'm curious about this as well. There was a post a few days back dealing with the same issue. I think you are able to nest validation rules for a form but I forgot the exact syntax. Maybe someone else could shed some light again on how to do this. -- Rick mailto:[EMAIL PROTECTED] If you go to a party, and you want to be the popular one at the party, do this: Wait until no one is looking, then kick a burning log out of the fireplace onto the carpet. Then jump on top of it with your body and yell, Log o' fire! Log o' fire! I've never done this, but I think it'd work. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail
Re: Validator and DispatchAction
Actually, I think I take that back. You want to actually skip certain fields if it is an insert or a delete. Making a method validation that returns false (fails) will stop all validation. You really probably want a dispatchMethodRequired validator and any other ones so they skip that validation if it shouldn't be checked. The other Validator methods kind of work like this with required. Everything else depends on required, but if you remove the dependecies all those methods, like mask, check if the field isn't blank before they perform the validation. If it is blank, mask returns true and doesn't really do anything. David --- William W [EMAIL PROTECTED] wrote: Good :) I will try !!! Thanks ! WIlliam. From: David Winterfeldt [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Thu, 13 Jun 2002 09:04:56 -0700 (PDT) You can't use booleans in the depends, but there can be dependencies setup between validation routines. You can make a method check pluggable validator and have required and other validator depend on it. Although the default configuration has everything depend on required so if required depends on something else, everything should work fine. Method would be checked first and then if it passes required would be next. validator name=method classname=MyDispatchMethodChecker method=validateDispatchMethod methodParams=java.lang.Object,org.apache.commons.validator.ValidatorAction,org.apache.commons.validator.Field,org.apache.struts.action.ActionErrors,javax.servlet.http.HttpServletRequest msg=errors.method/ validator name=required classname=org.apache.struts.util.StrutsValidator method=validateRequired methodParams=java.lang.Object,org.apache.commons.validator.ValidatorAction,org.apache.commons.validator.Field,org.apache.struts.action.ActionErrors,javax.servlet.http.HttpServletRequest depends=method msg=errors.required/ David --- William W [EMAIL PROTECTED] wrote: Is it possible ? Use boolean in the depends property ? field property=password depends=method OR required arg0 key=typeForm.password.displayname/ var var-namemethodName/var-name var-valueupdate/var-value /var /field From: William W [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Thu, 13 Jun 2002 14:46:09 + I think that if I use DispatchAction with ValidatorActionForm I will have the same problem. How can I validate the form for diferents methods in the same Action ? Am I wrong ? Thanks, William. From: David Winterfeldt [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED], Rick Reumann [EMAIL PROTECTED] Subject: Re: Validator and DispatchAction Date: Wed, 12 Jun 2002 14:42:51 -0700 (PDT) You would currently have to write your own required validation method and have it check a variable defined by a field to see if it should perform the validation or not. Or define a separate set of validation rules for each action and use ValidatorActionForm (which uses the action path to retrieve the validation rules). David --- Rick Reumann [EMAIL PROTECTED] wrote: On Wednesday, June 12, 2002, 10:14:09 AM, William wrote: WW I have a UserForm, the fields are : userId and userName. WW I have a UserAction that extends DispatchAction. The UserAction have two WW methods (insert and update). For the insert method only the userName is WW required, and for update method the userId and the userName are required. WW How can I can do a dependency validation with the validator.xml ? I'm curious about this as well. There was a post a few days back dealing with the same issue. I think you are able to nest validation rules for a form but I forgot the exact syntax. Maybe someone else could shed some light again on how to do this. -- Rick mailto:[EMAIL PROTECTED] If you go to a party, and you want to be the popular one at the party, do this: Wait until no one is looking, then kick a burning log out of the fireplace onto the carpet. Then jump on top of it with your body and yell, Log o' fire! Log o' fire! I've never done this, but I think it'd work. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL
Validator and DispatchAction
Hi ! I have a UserForm, the fields are : userId and userName. I have a UserAction that extends DispatchAction. The UserAction have two methods (insert and update). For the insert method only the userName is required, and for update method the userId and the userName are required. How can I can do a dependency validation with the validator.xml ? Thanks, William. _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Validator and DispatchAction
On Wednesday, June 12, 2002, 10:14:09 AM, William wrote: WW I have a UserForm, the fields are : userId and userName. WW I have a UserAction that extends DispatchAction. The UserAction have two WW methods (insert and update). For the insert method only the userName is WW required, and for update method the userId and the userName are required. WW How can I can do a dependency validation with the validator.xml ? I'm curious about this as well. There was a post a few days back dealing with the same issue. I think you are able to nest validation rules for a form but I forgot the exact syntax. Maybe someone else could shed some light again on how to do this. -- Rick mailto:[EMAIL PROTECTED] If you go to a party, and you want to be the popular one at the party, do this: Wait until no one is looking, then kick a burning log out of the fireplace onto the carpet. Then jump on top of it with your body and yell, Log o' fire! Log o' fire! I've never done this, but I think it'd work. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Validator and DispatchAction
You would currently have to write your own required validation method and have it check a variable defined by a field to see if it should perform the validation or not. Or define a separate set of validation rules for each action and use ValidatorActionForm (which uses the action path to retrieve the validation rules). David --- Rick Reumann [EMAIL PROTECTED] wrote: On Wednesday, June 12, 2002, 10:14:09 AM, William wrote: WW I have a UserForm, the fields are : userId and userName. WW I have a UserAction that extends DispatchAction. The UserAction have two WW methods (insert and update). For the insert method only the userName is WW required, and for update method the userId and the userName are required. WW How can I can do a dependency validation with the validator.xml ? I'm curious about this as well. There was a post a few days back dealing with the same issue. I think you are able to nest validation rules for a form but I forgot the exact syntax. Maybe someone else could shed some light again on how to do this. -- Rick mailto:[EMAIL PROTECTED] If you go to a party, and you want to be the popular one at the party, do this: Wait until no one is looking, then kick a burning log out of the fireplace onto the carpet. Then jump on top of it with your body and yell, Log o' fire! Log o' fire! I've never done this, but I think it'd work. -Jack Handey -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]