當前位置:
首頁 >
前端技术
> javascript
>内容正文
javascript
JSF的web.xml配置
生活随笔
收集整理的這篇文章主要介紹了
JSF的web.xml配置
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="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"><!-- **********JSF參數設置************************************* --><context-param><description>詳見:javax.faces.application.ProjectStage類可取值:DevelopmentUnitTestSystemTestProduction</description><param-name>javax.faces.PROJECT_STAGE</param-name><param-value>Development</param-value></context-param><context-param><description>指示是在客戶端(client)還是在服務器端(server)保存UI組件的狀態和session信息, server表示保存到服務器端,client表示保存到客戶端,默認為server。</description><param-name>javax.faces.STATE_SAVING_METHOD</param-name><param-value>client</param-value></context-param><context-param><description>當使用擴展名映射(后綴映射)時,所使用的資源的默認后綴默認為.jsp,它自于javax.faces.application.ViewHandler類中的常量. 常量的名字是 DEFAULT_SUFFIX 值相當于 ".jsp"</description><param-name>javax.faces.DEFAULT_SUFFIX</param-name><param-value>.xhtml</param-value></context-param><!--<context-param><description>當在這個應用中處理JSF請求時,所使用的生命周期實例的標識符.默認的生命周期模型</description><param-name>javax.faces.LIFECYCLE_ID</param-name><param-value></param-value></context-param>--><!-- ********************************************************* --><context-param><description>逗號分隔的上下文相關的資源路徑列表,JSF將在裝載WEB-INF/faces-config.xml之前載入這些資源</description><param-name>javax.faces.CONFIG_FILES</param-name><param-value>/WEB-INF/faces-config.xml</param-value></context-param><context-param><description>設置自定義的Facelets標簽庫文件路徑</description><param-name>javax.faces.FACELETS_LIBRARIES</param-name><param-value>/WEB-INF/guessnumber.taglib.xml</param-value></context-param><!-- ********************************************************* --> <context-param><description>Set this flag to true if you want the JSFReference Implementation to verify that all of the applicationobjects you have configured (components, converters,renderers, and validators) can be successfully created.Default value is false.告訴JSF驗證其可以創建應用對象(組件,呈現器,轉換器等), 那么設置標志為true, 默認值為false。</description><param-name>com.sun.faces.verifyObjects</param-name><param-value>false</param-value></context-param><context-param><description>Set this flag to true if you want the JavaServer FacesReference Implementation to validate the XML in yourfaces-config.xml resources against the DTD. Defaultvalue is false. 告訴JSF根據DTD驗證配置文件,那么設置標志為true, 默認值為false。</description><param-name>com.sun.faces.validateXml</param-name><param-value>false</param-value></context-param><!--<context-param><description>資源更新檢查周期</description><param-name>com.sun.faces.resourceUpdateCheckPeriod</param-name><param-value>-1</param-value></context-param><context-param><description>當狀態保存方法設置為server時,控制會話中保存的視圖數量.無默認值</description><param-name>com.sun.faces.NUMBER_OF_VIEWS_IN_SESSION</param-name><param-value>-1</param-value></context-param>--><!-- ********************************************************* --><!--<context-param><description>Setting this to true will cause the FaceletViewHandlerto print out debug information in an easy to use screenwhen an error occurs during the rendering process。很顯然,為了方便開發,我們應該設置。</description><param-name>facelets.DEVELOPMENT</param-name><param-value>true</param-value></context-param><context-param><param-name>facelets.SKIP_COMMENTS</param-name><param-value>true</param-value></context-param>--><!-- **********JSF基本設置************************************* --><!-- Faces Servlet --><servlet><servlet-name>Faces Servlet</servlet-name><servlet-class>javax.faces.webapp.FacesServlet</servlet-class><load-on-startup>1</load-on-startup></servlet><!-- Faces Servlet Mapping --><!--This mapping identifies a jsp page as having JSF content. If arequest comes to the server for foo.faces, the container willsend the request to the FacesServlet, which will expect acorresponding foo.jsp page to exist containing the content.--><servlet-mapping><servlet-name>Faces Servlet</servlet-name><url-pattern>*.faces</url-pattern><!--<url-pattern>*.xhtml</url-pattern<url-pattern>*.jsf</url-pattern><url-pattern>/faces/*</url-pattern>--></servlet-mapping><!-- **********Web基本設置************************************ --><session-config><session-timeout>30</session-timeout></session-config><welcome-file-list><welcome-file>index.html</welcome-file><welcome-file>index.jsp</welcome-file><welcome-file>index.xhtml</welcome-file></welcome-file-list><!-- **********安全設置**************************************** --><login-config><auth-method>FORM</auth-method><realm-name/><form-login-config><form-login-page>/login.jsp</form-login-page><form-error-page>/loginerror.jsp</form-error-page></form-login-config></login-config><security-role><role-name>manager</role-name></security-role><security-role><role-name>employee</role-name></security-role><security-constraint><web-resource-collection><web-resource-name>jsf</web-resource-name><description>javaserver faces</description><url-pattern>/security/*</url-pattern></web-resource-collection><auth-constraint><role-name>manager</role-name><role-name>employee</role-name></auth-constraint></security-constraint>
</web-app>
轉載于:https://my.oschina.net/liangzhenghui/blog/175556
總結
以上是生活随笔為你收集整理的JSF的web.xml配置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java程序课程总结_Java课程总结报
- 下一篇: 模型算法_数据分析师,要懂多少算法模型?