aspose file tools*
The moose likes Struts and the fly likes Strust2 validation problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Strust2 validation problem" Watch "Strust2 validation problem" New topic
Author

Strust2 validation problem

shah rah
Ranch Hand

Joined: Jan 04, 2007
Posts: 124
http://www.struts2.org/form-validation-in-struts2-basic-server-side-validation-example/

I tried validation example as in above link. The only validation that works is if I provide a non-numeric value in "AGE" field. None of the other validation works.

Can some one help me regarding this.

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Have you tried doing validation the way it's shown on the official Struts 2 documentation wiki?

(Although the code shown at the link seems okay from a quick glance; are you certain you've put the files in the correct places?) If you're having a problem with a third party's code, though, your best bet is to ask *them*. If you're having a specific issue with *your* code and/or configuration then you need to post it.
shah rah
Ranch Hand

Joined: Jan 04, 2007
Posts: 124
which folder should have actioname-validation.xml file? I am using TOMCAT and struts.xml is under classes directory.

appreciate your reply.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

It should be in the exact same package as the action class.
Bilal A. Siddiqui
Ranch Hand

Joined: Sep 14, 2008
Posts: 53

Hello All,

I also have a problem with struts2 validation

I have a registration page known as student registration.

there are few autocompleter fields like country dropdown, state drop down etc.

I am using struts2 validator to validate that none of the fields should be blank. If any field is blank it comes back to same page and displays the message in red that the particular field is required.

now the problem is when it comes back on same page incase of blank field the dropdowns are not working. Autocompleter is not generating the list.

Cheers!!! Bilal
Handsome Android||@bilal_speed||LinkedIn
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Please start new threads for new questions.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Strust2 validation problem