first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

JavaServer Faces in Action Notes: Chapter 1; Introducing JavaServer Faces; 1.5.4 Configuration with faces-config.xml; 1.5.5 Configuration with web.xml

1.5.4 Configuration with faces-config.xml

"Technically, JSF supports multiple configuration files, but we'll keep things simple for now."

"...a JSF configuration file is an XML document whose root node is <faces-config>..."

To reference beans via JSF EL expressions, JavaBeans can be declared with the <managed-bean> element. These beans are called managed beans. The <managed-bean-name> element contains the string that used in JSF EL expressions to refer to the managed bean. You can even initialize bean properties with the <managed-property> element.

"The managed bean name and the object's class name don't have to be the same."

"A navigation rule specifies the possible routes from a given page. Each route is called a navigation case." The <navigation-rule> element contains the <navigation-case> element.

1.5.5 Configuration with web.xml

"All J2EE web applications are configured with a web.xml deployment descriptor; Faces applications are no different." However, JSF deployment descriptors require that the <servlet> element contain a <servlet-class> declaration referencing the FacesServlet (javax.faces.webapp.FacesServlet).

With the <servlet> declaration, a <servlet-mapping> declaration must follow. In Eclipse running a Tomcat-based Dynamic Web Project, the auto-generated <url-pattern> element contains *.faces. This implies that your faces markup in hello.jsp can only be called with hello.faces. This does not imply that the <welcome-file-list> should contain <welcome-file> elements with hello.jsp or hello.faces.

mod date: 2007-03-12T22:15:33.000Z