免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
Apache myfaces介紹和配置

Apache myfaces介紹和配置

JSF是一個(gè)新的基于MVC模型的web應(yīng)用框架技術(shù)。在概念和特征方面,尤其是組件方面,超過(guò)了著名的Struts框架。而myfaces是Apache軟件基金的一個(gè)項(xiàng)目,它實(shí)現(xiàn)了JSF框架。同樣sun公司也有一個(gè)參考實(shí)現(xiàn) JSF RI。但是myfaces比JSF RI提供了更多的組件和特征。
可以參考:http://myfaces.apache.org/index.html 
http://java.sun.com/j2ee/javaserverfaces/
開發(fā)基于JSF的web應(yīng)用程序可以使用下列IDE(筆者已知):
myEclipse(Eclipse插件)  ,默認(rèn)同時(shí)支持JSF RI 和myfaces
http://www.myeclipseide.com/
Exadel(Eclipse插件)  默認(rèn)支持JSF RI
http://www.exadel.com/
Java Studio Creator 默認(rèn)支持JSF RI
oracle 的jDevelop 也支持JSF但是有自己的特色組件。

使用myfaces
myfaces官方的發(fā)行版本myfaces1.1.0中有四個(gè)jar包,分別 myfaces-api.jar,myfaces-impl.jar,tomahawk.jar,myfaces-all.jar。myfaces-all.jar包括了前三個(gè)jar包的所有

內(nèi)容。myfaces-api.jar,其實(shí)是JSF RI。tomahawk.jar是包含了myfaces實(shí)現(xiàn)的特色組件,可以單獨(dú)使用,在已經(jīng)使用JSF的web應(yīng)用程序中加入這個(gè)包就可以myfaces的組件,但是

無(wú)法使用myfaces的其他特征,如和struts-tiles結(jié)合。
筆者在myeclipse,tomcat5.0.28和jdk1.4.2中成功運(yùn)行基于myfaces的web應(yīng)用程序。并且沒用了筆者以前提到的JSF中文輸入亂碼的問題。但是在tomcat5.5.9和JDK1.5update4中

沒用調(diào)試成功,tomcat啟動(dòng)報(bào)錯(cuò),頁(yè)面無(wú)法顯示。在web\lib下加入myfaces的jar包后,還要在web.xml中加入如下片斷。

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="

xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee     <context-param>
    <param-name>javax.faces.CONFIG_FILES</param-name>
    <param-value>/WEB-INF/faces-config.xml</param-value>
  </context-param>

  <listener>
    <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
  </listener>

  <!-- 支持文件上傳功能,程序沒用文件上傳功能,這個(gè)也就不需要了-->
  <filter>
        <filter-name>extensionsFilter</filter-name>
        <filter-class>
                org.apache.myfaces.component.html.util.ExtensionsFilter
        </filter-class>
        <init-param>
                <description>
                        Set the size limit for uploaded files. Format: 10 - 10
                        bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
                </description>
                <param-name>uploadMaxFileSize</param-name>
                <param-value>100m</param-value>
        </init-param>
        <init-param>
                <description>
                        Set the threshold size - files below this limit are
                        stored in memory, files above this limit are stored on
                        disk.
                        Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
                </description>
                <param-name>uploadThresholdSize</param-name>
                <param-value>100k</param-value>
        </init-param>
     <!--
        <init-param>
                <param-name>uploadRepositoryPath</param-name>
                <param-value>/temp</param-value>
                <description>Set the path where the intermediary files will be stored.
                </description>
        </init-param>
       -->
</filter>

<filter-mapping>
        <filter-name>extensionsFilter</filter-name>
        <url-pattern>*.faces</url-pattern>
</filter-mapping>
<filter-mapping>
        <filter-name>extensionsFilter</filter-name>
        <url-pattern>/faces/*</url-pattern>
</filter-mapping>
 
  <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.faces</url-pattern>
  </servlet-mapping>
 
</web-app>


要在頁(yè)面使用myfaces組件,請(qǐng)?jiān)陧?yè)面中加入。
<%@ taglib uri="

參考:
http://wiki.apache.org/myfaces/How_to_add_MyFaces_support_to_a_Sun_JSF_RI_application
http://wiki.apache.org/myfaces/Installation_and_Configuration
http://myfaces.apache.org/index.html
http://myfaces.apache.org/gettingstarted.html

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
使用 JavaServer Faces 構(gòu)建 Apache Geronimo 應(yīng)用程序,第 2 部分: 在 JavaServer Faces 中使用 Tomahawk
web.xml
用JSF和MyFaces上傳文件
JSF Tour 5 MyFaces Intro
spring3 MVC實(shí)戰(zhàn),手工搭建Spring3項(xiàng)目demo
再回來(lái)改造 tomcat
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服