Open in new window

back

Create and Register a Custom Converter

  1. In the Project Explorer view open faces-config.xml and select Tree tab.

  2. Select Converters and click on Add button.
  3. Type the name of your converter in the Converter-id field and name the class for converters. After clicking Finish button your custom converter is registered under entered name.

  4. Let's create validator class. In the Converter section you should see your Converter-id and Converter-class. Click on Converter-class to generate the source code.

  5. Java class will be created automatically. Leave everything without changes and click Finish.

  6. To open converter class click again on Converter-class link in the Converter section. Now you are able to write business logic of converter.

back