• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Strust2 validation problem

 
shah rah
Ranch Hand
Posts: 124
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 124
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It should be in the exact same package as the action class.
 
Bilal A. Siddiqui
Ranch Hand
Posts: 53
Android Chrome Eclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please start new threads for new questions.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic