Java Reference
In-Depth Information
Note
Once the JSF facet is enabled, Eclipse will notify you that the JSF library configuration is
missing; just disable the JSF library configuration that is a part of Maven's duty.
Once JSF 2 facets are configured, if you press Ctrl + Space bar before referencing a field
or method, a suggestion pop-up window will let you choose the method or attribute of the
Bean you want to reference.
Getting ready to run the application
OK, now your application is almost ready. We just need to configure a JSF mapping in a
web.xml file as follows:
<web-app 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"
version="3.1">
<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>
<welcome-file-list>
<welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>
</web-app>
This will then run the FacesServlet servlet for all the pages at /faces/* url .
Search WWH ::




Custom Search