Manorrock.com / Demo JSF

JSF SSN converter demo

How to get this to work in your own page

This demo requires you to enter a SSN, if you do not enter a SSN it will show you an error. If you enter some values for the SSN it will call the validator to validate the SSN. The input field here requires you to enter the SSN, and if you add it with dashes it will silently ignore those. The converter will make sure it gets converted properly.

    <h:inputText required="true" requiredMessage="SSN is required" value="#{ssnBean.ssn}">
        <f:validator validatorId="com.manorrock.jsf.ssn.SSNValidator"/>
        <f:converter converterId="com.manorrock.jsf.ssn.SSNConverter"/>
    </h:inputText>
                    

Actual demo

Enter a SSN:

Up