Meaningless Drivel is fun!*
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
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: 1680
    
    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