This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Spring and the fly likes Multiple Error messages for Single regex validation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Multiple Error messages for Single regex validation" Watch "Multiple Error messages for Single regex validation" New topic
Author

Multiple Error messages for Single regex validation

preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
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

Joined: Mar 07, 2010
Posts: 1682
    
    7

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.


[How To Ask Questions][Read before you PM me]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multiple Error messages for Single regex validation
 
jQuery in Action, 3rd edition