File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts Validator framework

 
Udaya Raj
Greenhorn
Posts: 26
  • 0
  • 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
  • 0
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic