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

Multiple Error messages for Single regex validation

 
preethi Ayyappan
Ranch Hand
Posts: 518
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I am trying to validate a text field in Primefaces with # validations like
1. That field should have maximum of 99.99
2. That field should not allow alphabets
3. There should not be more than 2 digits after decimal point.

I have done the validation in regex . But I am unable to display the error messages according to the validation. I should display 3 error messages for the single text box validation. Please help me to do this using regex in annotation.

Thanks
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would typically use spring's JSR-303 support in addition with hibernate-validator. You can override the default messages for different constraint violations or implement your own custom constraints, annotations etc. I have used this with Spring-MVC but I don't really use JSF all that much. If your question is more JSF specific maybe the moderator can move this post to the JSF forum instead.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic