I have the following input field:
<h:inputText value=".." validator="#{labController.validateValue}"/>
If the field is empty it will not be validated (validateValue
in labController
is not called).
But using a separate validator class:
<h:inputText value=".." >
<f:validator validatorId="labDateValidator"/>
</h:inputText>
then its validate
method well be called even with an empty input field?
This is what I observe. Is this behavior dependent on implementation or version (I am using Mojarra 2.1) ?
Background is that I want to use my own method/class for all validation tasks including required validation. Does it work with validator class only?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…