Multiple validators for one entry

Is it possible to have multiple validators for a single entry in JSF 2.0? For example, let's say that I write the username and the username must contain 8 characters. And if OK, check to see if the username is in the database.

<ice:inputText id="username" value="#{createClient.username}" maxlength="15">
  <-- something like this -->
  <f:validator validatorId="usernameValidator" validatorId="usernameExistValidator" />
</ice:inputText> 
<ice:message for="username" />
+5
source share
1 answer

It is absolutely possible. You can attach as many validators to the component as you want, but you must use a separate tag for each of them.

eg.

<ice:inputText id="username" value="#{createClient.username}" maxlength="15">
  <f:validator validatorId="usernameValidator"/>
  <f:validator validatorId="usernameExistValidator" />  
</ice:inputText>
+11
source

All Articles