File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts2 validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 validation" Watch "Struts2 validation" New topic

Struts2 validation

Honzak Troubak
Ranch Hand

Joined: Jan 11, 2013
Posts: 31
Please could anybody help me?

I am trying use Struts2 validation but in still doesn't work and I don't know why.

I have form

where I want validate an email.

I have action class ViewUser and XML validationFile ViewUser-validation.xml in same package.

ViewUser-validation.xml contains

Has anybody any idea why it doesn't work? When I put to email editBox not email value nothing happened.

I looks like when it doesn't know about validation file. Validation file should name MyActionClass-validation.xml I think it's ok.

I use Maven2 is possible problem could be there?

Thanks so much
Yogesh Lonkar
Ranch Hand

Joined: Jul 17, 2012
Posts: 94

your validation.xml contains invalid validation syntax it should be as follow.

you placed <field-validator> inside another <field-validator>

Learning some thing New Every Day
I agree. Here's the link:
subject: Struts2 validation
It's not a secret anymore!