Announcement Announcement Module
No announcement yet.
Understanding JSR 303, messagesa and binding Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Understanding JSR 303, messagesa and binding

    I have been using Spring 3.06 and Hibernate-Validation 4.0 as the validation on my web app models. It seems easy enough to setup and extend but I have one outstanding question. I spent some time reading the forums and searching the web but never really came up with a good answer so I though I would post it here.

    I have a instance where I have a cross field validation on fields with a list of objects in a table. The error messages need to be displayed at the end of each row. I got the simple annotations like @Min and @Range to work by using error tag with the path of "classname[index].*". no problems here everything displays fine.

    I also figured out how to create a class level constraint to validate the two fields in each instance of each object in the list. No problems there either.

    My issue getting the error messages to display at the end of each row. How do I get the message to go the correct field level <form:error> tag based on the path given. The message ends up added it to the "BindingResult" with the "classname[index]" as expected and it is not picked up by the path of "classname[index].*'. If I change the <error> tags path to just "classname[index]" I do not get any messages. so I am sure there is simple and easy fix I have just not been able to find.

    Thank you in advance for any input