You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jim Reynolds <ji...@gmail.com> on 2006/10/17 23:10:01 UTC

Struts2 Validation Question

Downloaded and extracted the struts2-showcase-2.0.1.war file to my
tomcat server. I am looking at the validation/quizBasic!input.action
and I am confused on how the validtion on these fields is set. I am
accustomzed to using 1.x.

Could someone please explain how the validation for these three fields works?

Thanks,

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2 Validation Question

Posted by Ted Husted <hu...@apache.org>.
S2 Validation follows a "config-behind-class" model. You define a
validation file for the Action class (or other JavaBean) that needs to
be validated, and place it in the same package/folder. The validation
follows the class hierarchy, so that if a class is extended, the
subclass inherits the validator. There is also an alternative syntax
so that you can specify a validation for a particular method on an
Action class. The latter is helpful when you are passing several
"CRUD" methods through the same Aciton class, dispatch-style.

For more, see

* http://cwiki.apache.org/WW/validation.html

-- HTH, Ted.
* http://www.husted.com/struts/

On 10/17/06, Jim Reynolds <ji...@gmail.com> wrote:
> Downloaded and extracted the struts2-showcase-2.0.1.war file to my
> tomcat server. I am looking at the validation/quizBasic!input.action
> and I am confused on how the validtion on these fields is set. I am
> accustomzed to using 1.x.
>
> Could someone please explain how the validation for these three fields works?
>
> Thanks,

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org