background image

Verifying Custom Objects

<< Turning On Validation of XML Files | Including the Required JAR Files >>
<< Turning On Validation of XML Files | Including the Required JAR Files >>

Verifying Custom Objects

7. In the Add Context Parameter dialog:
a. Enter com.sun.faces.validateXml in the Param Name field.
b. Enter true in the Param Value field.
c. Click OK.
To set the flag in the deployment descriptor directly, do the following:
1. Add a context-param element to the deployment descriptor.
2. Add a param-name element inside the context-param element and give it the name
com.sun.faces.validateXml
.
3. Add a param-value element to the context-param element and give it the value true. The
default value is false.
Verifying Custom Objects
If your application includes custom objects, such as custom components, converters, validators,
and renderers, you can verify when the application starts that they can be created. To do this,
you set the verifyObjects flag to true.
To set the flag using NetBeans IDE, do the following:
1. Expand the node of your project in the Projects pane.
2. Expand the Web Pages and WEB-INF nodes that are under the project node.
3. Double-click web.xml.
4. After the web.xml file appears in the editor pane, click General at the top of the editor pane.
5. Expand the Context Parameters node.
6. Click Add.
7. In the Add Context Parameter dialog:
a. Enter com.sun.faces.verifyObjects in the Param Name field.
b. Enter true in the Param Value field.
c. Click OK.
To set the flag in the deployment descriptor directly, do the following:
1. Add a context-param element to the deployment descriptor.
2. Add a param-name element inside the context-param element and give it the name
com.sun.faces.verifyObjects
.
3. Add a param-value element to the context-param element and give it the value true. The
default value is false.
Normally, this flag should be set to false during development because it takes extra time to
check the objects.
Basic Requirements of a JavaServer Faces Application
Chapter 14 · Configuring JavaServer Faces Applications
465