新建maven工程,选择web工程
增加jsf框架,加入primefaces
部署到服务器,在浏览器中打开页面,这是primefaces框架的页面。
此时工程web目录下有如下文件
web.xml文件
复制代码
代码如下:<?xml version="1.0" encoding="UTF-8"?></p> <p><web-app version="3.0" xmlns="<a href="http://java.sun.com/xml/ns/javaee">http://java.sun.com/xml/ns/javaee</a>" xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>" xsi:schemaLocation="<a href="http://java.sun.com/xml/ns/javaee">http://java.sun.com/xml/ns/javaee</a> <a href="http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd</a>"></p> <p><context-param></p> <p><param-name>javax.faces.PROJECT_STAGE</param-name></p> <p><param-value>Development</param-value></p> <p></context-param></p> <p><servlet></p> <p><servlet-name>Faces Servlet</servlet-name></p> <p><servlet-class>javax.faces.webapp.FacesServlet</servlet-class></p> <p><load-on-startup>1</load-on-startup></p> <p></servlet></p> <p><servlet-mapping></p> <p><servlet-name>Faces Servlet</servlet-name></p> <p><url-pattern>/faces/*</url-pattern></p> <p></servlet-mapping></p> <p><session-config></p> <p><session-timeout></p> <p>30</p> <p></session-timeout></p> <p></session-config></p> <p><welcome-file-list></p> <p><welcome-file>faces/index.xhtml</welcome-file></p> <p></welcome-file-list></p> <p></web-app>