• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Multiple Error messages for Single regex validation

 
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
This one time, at bandcamp, I had relations with a tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic