Create a file With name UserAction-validation.xml
and copy the below content
go through the struts2 validation frame work
<validators>
<field name="usr.userId">
<field-validator type="requiredstring">
<message>School name required</message>
</field-validator>
</field>
</validators>
On 2/6/08, slideharmony <[EMAIL PROTECTED]> wrote:
>
>
> Hello!
> I have to validate a composed object in my action, this is my action:
>
>
> public class UserAction extends ActionSupport{
>
> private User usr;
>
> public User getUser() {return usr;}
> public void setUser(User usr) {this.usr = usr;}
>
> }
>
>
>
>
> and this is User class:
>
> public class User{
>
> private String usrId;
>
> public String getUsrId(){
> return usrId;
> }
>
> public void setUsrId(String usrId){
> this.usrId = usrId;
> }
>
>
> }
>
>
> How can I validate usrId property with annotations or xml
> without putting annotations inside User class?
>
> Any help would be appreciate!
>
> Thanks in advance,
> Riccardo
> --
> View this message in context:
> http://www.nabble.com/How-can-I-validate-a-composed-object-in-my-action-%28Struts-2%29-tp15306468p15306468.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>