Java Reference
In-Depth Information
This is shown in the following code:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>
</web-app>
As we can see, NetBeans automatically sets the JSF project stage to Development .
Setting the project stage to Development configures JSF to provide additional
debugging help that is not present in other stages. For example, one common
problem when developing a JSF page is that while a page is being developed,
validation for one or more fields on the page fails but the developer has not added
an <h:message> or <h:messages> tag to the page (more on this later). When this
happens and the form is submitted, the page seems to do nothing, or page navigation
doesn't work properly. When setting the project stage to Development , these
validation errors will automatically be added to the page, without the developer
having to explicitly add one of these tags to the page (we should, of course, add
the tags before releasing our code to production, since our users will not see the
automatically generated validation errors).
 
Search WWH ::




Custom Search