You are on page 1of 2

How to Create a Backing Bean Validation Method (12.4.1 – 12.4.

2)
㪌㹡óշÕèµoŒ §¡Òà Validate component e¾Õ§˹ŒÒe´ÕÂÇe·‹Ò¹aé¹
1. Insert the component that will require validation into the JSF page.

2. In the visual editor, double-click the component to launch the Bind Validator Property
dialog. In the Bind Validator Property dialog, enter or select the managed bean that
will hold the validation method, or click New to create a new managed bean. Use
the default method signature provided or select an existing method if the logic
already exists.

Page 1 of 2
When you click OK in the dialog, JDeveloper adds a skeleton method to the code
and opens the bean in the source editor.

3. Add the needed validation logic. This logic should use


javax.faces.validator.ValidatorException to throw the appropriate exceptions and
javax.faces.application.FacesMessage to generate the corresponding error messages.

Page 2 of 2

You might also like