This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
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

Win a copy of Java 8 in Action this week in the Java 8 forum!
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
Consider Paul's rocket mass heater.
subject: Struts2 validation
Similar Threads
validation in struts2
struts2 - maven validation
Struts2 & validation [SOLVED]
Struts2 validation