web.xml中配置
http://klxwcx.iteye.com/blog/1006360#bc2294025
- <?xmlversion="1.0"encoding="UTF-8"?>
- <web-appversion="2.5"xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
- http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
- <context-param>
- <param-name>
- org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL
- </param-name>
- <param-value>true</param-value>
- </context-param>
- <context-param>
- <param-name>javax.faces.CONFIG_FILES</param-name>
- <param-value>/WEB-INF/config/faces-config.xml</param-value>
- </context-param>
- <!-- MyFaces start -->
- <listener>
- <listener-class>
- org.apache.myfaces.webapp.StartupServletContextListener
- </listener-class>
- </listener>
- <!-- MyFaces end -->
- <!-- Tomahawk start -->
- <filter>
- <filter-name>MyFacesExtensionsFilter</filter-name>
- <filter-class>
- org.apache.myfaces.webapp.filter.ExtensionsFilter
- </filter-class>
- <init-param>
- <param-name>uploadMaxFileSize</param-name>
- <param-value>20m</param-value>
- </init-param>
- </filter>
- <!-- extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages -->
- <filter-mapping>
- <filter-name>MyFacesExtensionsFilter</filter-name>
- <!-- servlet-name must match the name of your javax.faces.webapp.FacesServlet entry -->
- <servlet-name>Faces Servlet</servlet-name>
- </filter-mapping>
- <!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) -->
- <filter-mapping>
- <filter-name>MyFacesExtensionsFilter</filter-name>
- <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
- </filter-mapping>
- <!-- Tomahawk end -->
- <!-- richfaces start -->
- <context-param>
- <param-name>org.ajax4jsf.SKIN</param-name>
- <param-value>blueSky</param-value>
- </context-param>
- <context-param>
- <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
- <param-value>false</param-value>
- </context-param>
- <filter>
- <display-name>Ajax4jsf Filter</display-name>
- <filter-name>ajax4jsf</filter-name>
- <filter-class>org.ajax4jsf.Filter</filter-class>
- <init-param>
- <param-name>forceparser</param-name>
- <param-value>false</param-value>
- </init-param>
- </filter>
- <filter-mapping>
- <filter-name>ajax4jsf</filter-name>
- <servlet-name>Faces Servlet</servlet-name>
- <dispatcher>FORWARD</dispatcher>
- <dispatcher>REQUEST</dispatcher>
- <dispatcher>INCLUDE</dispatcher>
- </filter-mapping>
- <!-- richfaces end -->
- <!-- facelets start -->
- <context-param>
- <param-name>facelets.DEVELOPMENT</param-name>
- <param-value>true</param-value>
- </context-param>
- <context-param>
- <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
- <param-value>com.sun.facelets.FaceletViewHandler</param-value>
- </context-param>
- <context-param>
- <param-name>com.sun.faces.validateXml</param-name>
- <param-value>true</param-value>
- <!-- description>
- Set this flag to true if you want the JavaServer Faces
- Reference Implementation to validate the XML in your
- faces-config.xml resources against the DTD. Default
- value is false.
- </description -->
- </context-param>
- <!--context-param>
- <param-name>com.sun.faces.verifyObjects</param-name>
- <param-value>true</param-value>
- <description>
- Set this flag to true if you want the JavaServer Faces
- Reference Implementation to verify that all of the application
- objects you have configured (components, converters,
- renderers, and validators) can be successfully created.
- Default value is false.
- </description>
- </context-param>
- -->
- <context-param>
- <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
- <param-value>.xhtml</param-value>
- </context-param>
- <context-param>
- <param-name>facelets.REFRESH_PERIOD</param-name>
- <param-value>2</param-value>
- </context-param>
- <context-param>
- <param-name>facelets.DEVELOPMENT</param-name>
- <param-value>true</param-value>
- </context-param>
- <context-param>
- <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
- <param-value>client</param-value>
- </context-param>
- <!-- facelets end -->
- <!-- Faces Servlet -->
- <servlet>
- <servlet-name>Faces Servlet</servlet-name>
- <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
- <load-on-startup>0</load-on-startup>
- </servlet>
- <!-- Faces Servlet Mapping -->
- <servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>*.faces</url-pattern>
- </servlet-mapping>
- <servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>*.jsf</url-pattern>
- </servlet-mapping>
- <login-config>
- <auth-method>BASIC</auth-method>
- </login-config>
- <session-config>
- <session-timeout>30</session-timeout>
- </session-config>
- <welcome-file-list>
- <welcome-file>index.jsp</welcome-file>
- </welcome-file-list>
- </web-app>
需要的jar
- common-annotations.jar
- commons-beanutils-1.7.0.jar
- commons-codec-1.3.jar
- commons-collections-3.2.jar
- commons-digester-1.8.jar
- commons-discovery-0.4.jar
- commons-el-1.0.jar
- commons-fileupload-1.2.1.jar
- commons-io-1.4.jar
- commons-logging-1.1.1.jar
- jsf-api.jar
- jsf-facelets.jar
- jsf-impl.jar
- jstl-1.1.0.jar
- myfaces-api-1.2.7.jar
- myfaces-impl-1.2.7.jar
- richfaces-api-3.2.0.GA.jar
- richfaces-impl-3.2.0.GA.jar
- richfaces-ui-3.2.0.GA.jar
- standard.jar
- tomahawk-1.1.9.jar
- <context-param>
- <param-name>
- org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL
- </param-name>
- <param-value>false</param-value>
- </context-param>