You need to define a <result> of type input for your action. -----Original Message----- From: 928572663 [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 21, 2008 11:02 AM To: Struts Users Mailing List Subject: [s2] Problem getting basic server side field validation to work
I'm trying to do a very basic test app that demonstrates the server side field validation and am getting an exception during initial JSP page rendering. The page and action work fine without the validation. Any ideas what I may be missing? I've read the confluence pages on validation, and have been keeping up with the many posts on the mailing list, but they all seem to be various advanced scenarios. Here is some info to help: * Using struts 2.1.2 basic (no plugins to speak of) * Using Zero Configuration (annotations) with no struts.xml * form bean is stored in session * action function works great w/o validation * when adding the SampleAction-validation.xml the exception happens during initial page rendering Here is the stack and last few logs: DEBUG [] [2008/10/21 09:01:12] [com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor] Invoking validate() on action [EMAIL PROTECTED] DEBUG [] [2008/10/21 09:01:12] [com.opensymphony.xwork2.interceptor.PrefixMethodInvocationUtil] cannot find method [validateDisplayForm] in action [EMAIL PROTECTED] DEBUG [] [2008/10/21 09:01:12] [com.opensymphony.xwork2.interceptor.PrefixMethodInvocationUtil] cannot find method [validateDoDisplayForm] in action [EMAIL PROTECTED] DEBUG [] [2008/10/21 09:01:12] [com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor] Errors on action [EMAIL PROTECTED], returning result name 'input' ERROR [] [2008/10/21 09:01:12] [org.apache.struts2.dispatcher.Dispatcher] Could not find action or result No result defined for action sample.SampleAction and result input at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultAct ionInvocation.java:357) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo cation.java:259) at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(Vali dationInterceptor.java:248) at org.apache.struts2.interceptor.validation.AnnotationValidationIntercepto r.doIntercept(AnnotationValidationInterceptor.java:49) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Me thodFilterInterceptor.java:86) /SampleAction-validation.xml <!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" "http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd"> <validators> <field name="formBean.lastName"> <field-validator type="requiredstring"> <message>You must enter a Last Name</message> </field-validator> </field> <field name="formBean.maxValue"> <field-validator type="int"> <param name="min">13</param> <param name="max">19</param> <message>The max value must be between 13 and 19</message> </field-validator> </field> </validators> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]