• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Strust2 validation problem

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It should be in the exact same package as the action class.
 
Ranch Hand
Posts: 53
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please start new threads for new questions.
 
knowledge is the difference between drudgery and strategic action -- tiny ad
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic