struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kawczynski, David" <>
Subject RE: [s2] Problem getting basic server side field validation to work
Date Tue, 21 Oct 2008 15:14:10 GMT
You need to define a <result> of type input for your action. 

-----Original Message-----
From: 928572663 [] 
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] 
Invoking validate() on action sample.SampleAction@17cad35
DEBUG [] [2008/10/21 09:01:12] 
[com.opensymphony.xwork2.interceptor.PrefixMethodInvocationUtil] cannot 
find method [validateDisplayForm] in action
DEBUG [] [2008/10/21 09:01:12] 
[com.opensymphony.xwork2.interceptor.PrefixMethodInvocationUtil] cannot 
find method [validateDoDisplayForm] in action
DEBUG [] [2008/10/21 09:01:12] 
[com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor] Errors 
on action sample.SampleAction@17cad35, 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


<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 
    <field name="formBean.lastName">
       <field-validator type="requiredstring">
          <message>You must enter a Last Name</message>
    <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>

To unsubscribe, e-mail:
For additional commands, e-mail:

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 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:
For additional commands, e-mail:

View raw message