• 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

Unknown validator id in JSF2

 
Ranch Hand
Posts: 171
Spring Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I'm invoking .xhtml page which is constructed by JSF2 with custom validation attached, but error occurs as "Unknown validator id:". Used the @FacesValidator(value="validator_id"), but everything works fine if I do the configure in faces_config.xml. I've searched for it, end of up with none. Kindly help me on this.

Here is my java class file which implements validator interface,



xhtml file used the above validator class to validate one of the input field.

 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know what effect the "RequestScoped" attribute is having, but validators are not backing beans, although validator methods can be implements within backing beans. Remove the scope attribute.

You should be able to specify an unqualified "@FacesValidator" on the class definition and that would construct the default ID of "com.firstjsf2.EmailValidator" if my memory is accurate. And, of course, assuming that the bean is in the "com.firstjsf2" package.
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello

Why don't you use the Bean Validation (JSR 303)? Are you using Java EE 6?

[]'s
 
Where all the women are strong, all the men are good looking and all the tiny ads are above average:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic