This week's book giveaway is in the Android forum.
We're giving away four copies of Learning Java by Building Android Games and have Jean-Marcel Belmont on-line!
See this thread for details.
Win a copy of Learning Java by Building Android Games this week in the Android forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

about how to use validator  RSS feed

 
Ranch Hand
Posts: 1703
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, as a friendly reminder, I took some notes on the usage of validator which is important for the exam.
The validator attribute and f:validator always confuse people.

As we know we have <h:inputText ... validator="{any method expression}"/>, or <f:validator validatorId="any validator id"} , there is still another usage like this:
<h:inputText...>
   <f:validator binding="#{name of a validator which is a managed bean}
</h:inputText>
For example,


The jsf to use it is :
<h:inputText ...>
         <f:validator binding="#{EmailValidator1}"/>
</h:inputText>

Reference:https://bitbucket.org/paulstat/oracle-jsf-expert-1z0-896/wiki/Custom%20validators
In the above reference, Paul uses CDI bean for the validator. But it does not work with my Glassfish. It may work with other containers.

 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!