How to pass second value in JSF validator?

jsf, jsf-2

Solution

`<f:attribute>` comes to mind. Add one to the inputtext and retrieve it in the validator.

<h:inputText id="dcname".....
<f:attribute name="param" value="myparam" /> 
</h:inputText>

And:

String param = (String) component.getAttributes().get("param"); 

Can get the value from EL. Good luck

Problem

I have a simple JSF input form into edit page and Validator which checks the value for duplication: ``` <td>Name</td> <td> <h:outputText value="#{ud.name}" rendered="#{not DCProfileTabGeneralController.editable}" /> <h:inputText id="dcname" value="#{ud.name}" rendered="#{DCProfileTabGeneralController.editable}" validator="#{ValidatorDatacenterController.validateDatacenterName}" autocomplete="off"> <f:ajax event="blur" render="dcnamevalidator" /> </h:inputText> <h:message id="dcnamevalidator" for="dcname" /> </td> public void validateDatacenterName(FacesContext context, UIComponent component, Object value){ .... } ``` I'm interested is there any possible way to send a second value which will be used into the validation process?

Original source