Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Struts Validator framework

 
Udaya Raj
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a form which has the date feild to be validated

<CODE>
<form name="formname">
.
.
<form-field property="dob" depends="date,dateRange">
<msg name="dateRange" key="errors.field.range3" />
</form>


</form>

I like to give different error message for failure in date and dateRange failure. We have a custom validator where we have implemented the validateDate and validateDateRange methods. There we get the error message Resources.getActionError(request,va, field)); I like to know how to get different messages.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You specify the error message in the "msg" attribute of the validator tag in the validator-rules.xml.
 
Let's get him boys! We'll make him read this tiny ad!
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!