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(DefaultActionInvocation.java:357) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:259) at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:248) at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:49) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.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]

Reply via email to