Version 3

    In jsf if we want to get a substring from a string then we can write a converter.

    This converter has two types of methods one returns an object and another one returns a string.



    To use a converter we need to use the following lines of code into faces config file.

    <!-- Declaring an id for the converter -->


          <converter-id>converterId</converter-id> <-- This is converter id that will be used with component.






    <!---- How to use converter with the defined id -- >


    <h:outputText value="#{}" converter="converterId" />