wood burning stoves*
The moose likes Struts and the fly likes struts 2: how to validate text fields in a collection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts 2: how to validate text fields in a collection" Watch "struts 2: how to validate text fields in a collection" New topic
Author

struts 2: how to validate text fields in a collection

Vinny Menon
Ranch Hand

Joined: Jan 10, 2006
Posts: 62

greetings Fellow Ranchers,

i have a jsp in which i show a list of PersonVO in the iterate tag. the fields being : firstname,lastname,age. My Action class is PersonAction.java


how do i put the validation in PersonAction-validation.xml?and what will be the validation to iterate through the collection?
required validations being:
  • fname,lname should not be blank.
  • age should be numeric and non-zero


  • Thanks and Regards,
    VINNY M


    Regards,Vinny M.
    proud Fan of European Champion CHELSEA FC
    "If you don't see the bug where you're looking, perhaps you're looking in the wrong place" -James Gosling
    Mohana Rao Sv
    Ranch Hand

    Joined: Aug 01, 2007
    Posts: 485

    Explore fieldError in Struts 2


    ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
     
     
    subject: struts 2: how to validate text fields in a collection
     
    Similar Threads
    Struts 2 checkboxlist error - list key could not be resolved
    please figure this out..
    Displaying values in JSP using Struts Tag
    struts2 tag ?
    How to retain automatically generated fields on pageload in struts2