Open in new window

back

Create and Register a Custom Validator

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

  2. Select Validators and click on Add button.
  3. Type the name of your validator in the Valifator-id field and name the class for validators. After clicking Finish button your custom validator is registered under entered name.

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

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

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

back