锘??xml version="1.0" encoding="utf-8" standalone="yes"?>九九免费精品视频在线观看,中文在线三区,91精品啪在线观看国产18http://www.aygfsteel.com/guangcaiwudong/category/53237.htmlzh-cnFri, 18 Jan 2013 13:20:22 GMTFri, 18 Jan 2013 13:20:22 GMT60JSF鍙傛暟浼犻掓柟寮忎箣涓錛歠:param鏍囩 http://www.aygfsteel.com/guangcaiwudong/articles/393164.htmlKevin_YKKevin_YKTue, 18 Dec 2012 09:07:00 GMThttp://www.aygfsteel.com/guangcaiwudong/articles/393164.htmlhttp://www.aygfsteel.com/guangcaiwudong/comments/393164.htmlhttp://www.aygfsteel.com/guangcaiwudong/articles/393164.html#Feedback0http://www.aygfsteel.com/guangcaiwudong/comments/commentRss/393164.htmlhttp://www.aygfsteel.com/guangcaiwudong/services/trackbacks/393164.html
欏甸潰鍒癇ean鐨勫弬鏁頒紶閫?/span>
欏甸潰涓緗弬鏁幫細
Java浠g爜 澶嶅埗浠g爜
  1. <h:form>   
  2.             <h:commandLink value="Test2" action="#{paramBean.test}">   
  3.                 <f:param name="name" value="zhang"></f:param>   
  4.                 <f:param name="id" value="123456"></f:param>   
  5.             </h:commandLink>   
  6. </h:form>  

娉ㄦ剰:榪欓噷鍙兘浣跨敤h:commandLink鏍囩錛岃屼笉鑳戒嬌鐢╤:commandButton鏍囩!
鍚庡彴鍙栧弬鏁幫細
(1) 閫氳繃Request瀵硅薄鍙栧?
Java浠g爜 澶嶅埗浠g爜
  1. HttpServletRequest request = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();   
  2.         request.getParameter("name");  

        (2)閫氳繃RequestParameterMap鍙栧?
Java浠g爜 澶嶅埗浠g爜
  1. Map varMap = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();   
  2.         varMap.get("id");  

        (3)閫氳繃閰嶇疆鏂囦歡榪涜Bean鐨勫睘鎬у兼敞鍏ワ紝鍦˙ean鐨勬柟娉曚腑鐩存帴浣跨敤灞炴?
Java浠g爜 澶嶅埗浠g爜
  1. <managed-bean>   
  2.   <managed-bean-name>paramBean</managed-bean-name>   
  3.   <managed-bean-class>com.spg.bean.ParamBean</managed-bean-class>   
  4.   <managed-bean-scope>request</managed-bean-scope>   
  5.   <managed-property>   
  6.    <property-name>id</property-name>   
  7.    <property-class>java.lang.String</property-class>   
  8.    <value>#{param.id} </value>   
  9.   </managed-property>   
  10. </managed-bean>  

欏甸潰鍒伴〉闈㈢殑鍙傛暟浼犻?/span>
欏甸潰涓緗弬鏁幫細
(1)
Java浠g爜 澶嶅埗浠g爜
  1. <h:outputLink value="param2.jsf">   
  2.                 <h:outputText value="Test4"></h:outputText>   
  3.                 <f:param name="name" value="chen"></f:param>   
  4.                 <f:param name="id" value="123456"></f:param>   
  5.     </h:outputLink>  

(2)
Java浠g爜 澶嶅埗浠g爜
  1. <h:outputLink value="param2.jsf?name=chen&id=123456">   
  2.                 <h:outputText value="Test4"></h:outputText>   
  3.     </h:outputLink>  

娉ㄦ剰錛氫互涓婁袱縐嶆柟娉曪紝涓嶈兘鍚屾椂浣跨敤!
欏甸潰涓彇鍙傛暟錛?
(1) 浣跨敤JSF鐨勫艱〃杈懼紡
Java浠g爜 澶嶅埗浠g爜
  1. <h:outputText value="#{param.name}"></h:outputText>    
  2.     <h:outputText value="#{param.id}"></h:outputText>  

(2) 浣跨敤JSP鐨勮〃杈懼紡
Java浠g爜 澶嶅埗浠g爜
  1. <%=request.getParameter("name")%>   
  2.     <%=request.getParameter("id")%>  


Kevin_YK 2012-12-18 17:07 鍙戣〃璇勮
]]>
h:commandButton 鍜?h:commandLink 鍖哄埆http://www.aygfsteel.com/guangcaiwudong/articles/393161.htmlKevin_YKKevin_YKTue, 18 Dec 2012 08:58:00 GMThttp://www.aygfsteel.com/guangcaiwudong/articles/393161.htmlhttp://www.aygfsteel.com/guangcaiwudong/comments/393161.htmlhttp://www.aygfsteel.com/guangcaiwudong/articles/393161.html#Feedback0http://www.aygfsteel.com/guangcaiwudong/comments/commentRss/393161.htmlhttp://www.aygfsteel.com/guangcaiwudong/services/trackbacks/393161.html鏈閲嶈鐨勪竴涓尯鍒紝h:commandButton 涓嶈兘浼?strong style="color:white;background-color:#880000">鍙傛暟

eg:<h:commandButton>
<f:param name="id" value="1"/>
</h:commandButton>
鍦ㄥ悗鍙癰ean鏄敹涓嶅埌榪欎釜1鐨勶紝鑰岀敤h:commandLink娌℃湁闂

濡傛灉涓瀹氳鐢?strong style="color:black;background-color:#ff9999">button錛屽彲浠ョ敤a4j:commandButton,榪欎釜鍙互浼?strong style="color:white;background-color:#880000">鍙傛暟

Kevin_YK 2012-12-18 16:58 鍙戣〃璇勮
]]>
鍏充簬f:setPropertyActionListener鏍囩鐨勯棶棰?http://www.aygfsteel.com/guangcaiwudong/articles/392878.htmlKevin_YKKevin_YKWed, 12 Dec 2012 07:52:00 GMThttp://www.aygfsteel.com/guangcaiwudong/articles/392878.htmlhttp://www.aygfsteel.com/guangcaiwudong/comments/392878.htmlhttp://www.aygfsteel.com/guangcaiwudong/articles/392878.html#Feedback0http://www.aygfsteel.com/guangcaiwudong/comments/commentRss/392878.htmlhttp://www.aygfsteel.com/guangcaiwudong/services/trackbacks/392878.html

鍐欎簡涓涓畝鍗曡嚦鏋佺殑JSF欏甸潰錛屽涓嬶細

<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<html>
    <head>
        <title>Hello</title>
    </head>

    <body>
        <f:view>
            <h:form>
                <h:commandButton actionListener="#{testBean.sayHello}" value="Hello錛?>
               
                    <f:setPropertyActionListener target="#{testBean.userName}"
                        value="zhangsan" />
                       
                    <f:actionListener type="myex2.lc.MyActionListener"/>
                   
                </h:commandButton>
            </h:form>
        </f:view>
    </body>
</html>

 

 

瀵瑰簲鐨凚ean濡備笅錛?/p>

 

package myex2.lc;

import javax.faces.event.ActionEvent;

public class TestBean {
   
    private String userName;

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }   
   
    public void sayHello(ActionEvent evt) {
        System.out.println("sayWord: Hello, " + userName);
    }
}

鎺у埗鍙頒笂鐨勮緭鍑虹粨鏋滀細鏄粈涔堝憿錛熺瓟妗堝涓嬶細

sayWord: Hello, null
MyActionListener: Hello, zhangsan

 

涓轟粈涔堜袱涓狝ctionListener錛坰ayHello鏂規(guī)硶鍜?<f:actionListener type="myex2.lc.MyActionListener"/>錛夌殑杈撳嚭浼氫笉涓鏍鳳紵

鍘熷洜鍦ㄤ簬<f:setPropertyActionListener>涔熸槸涓涓狝ctionListener錛屾誨叡3涓狝ctionListener鎵ц鐨勯『搴忎笉鍚屻?/p>

 

姝e父鎯呭喌涓嬶紝attribute涓0鏄庣殑鏂規(guī)硶ActionListener錛屾繪瘮<f:actionListener>綾葷殑ActionListener鍏堟墽琛岋紱

鑰屽悗<f:actionListener>綾葷殑ActionListener鍐嶆寜澹版槑鐨勫厛鍚庨『搴忎緷嬈℃墽琛屻?/strong>


鎵浠ュ湪榪欎釜渚嬪瓙閲岄潰鎵ц鐨勯『搴忔槸錛?{testBean.sayHello} -> <f:setPropertyActionListener> -> <f:actionListener>銆?/p>

鍚屾椂涔熷彲鐪嬪嚭錛屽浜巃ttribute綾葷殑ActionListener錛岄氳繃<f:setPropertyActionListener>浼犻掑弬鏁頒技涔庡茍涓嶆槸涓涓ソ鍔炴硶錛岃繕闇瑕佹瀯寤篤alueExpression鍘繪眰鍊鹼紝姣旇緝楹葷儲銆?/p>

鑰屽彲浠ラ噰鐢?lt;f:attribute>浠f浛錛屽啀鐢ˋctionEvent鐨刧etComponent() -> getAttributes()瑙f瀽鍑哄弬鏁幫紝鐩稿鏂逛究涓浜涖?/p>

鑰?strong style="color:black;background-color:#ff66ff">action灞炴ф繪槸鍦ㄥ悇綾籄ctionListener鎵ц涔嬪悗鎵嶈璋冪敤錛屽洜姝ゆ病鏈夋綾誨共鎵般?/p>

浠ヤ笂鎯呭喌錛屼篃鍙帹鍙奦alueChangeListener銆?/p>



鎽樿嚜http://blog.csdn.net/gengv/article/details/4211794



Kevin_YK 2012-12-12 15:52 鍙戣〃璇勮
]]>
Richfaces鎸夐挳浜嬩歡鎵ц鐨勯『搴?/title><link>http://www.aygfsteel.com/guangcaiwudong/articles/392876.html</link><dc:creator>Kevin_YK</dc:creator><author>Kevin_YK</author><pubDate>Wed, 12 Dec 2012 07:46:00 GMT</pubDate><guid>http://www.aygfsteel.com/guangcaiwudong/articles/392876.html</guid><wfw:comment>http://www.aygfsteel.com/guangcaiwudong/comments/392876.html</wfw:comment><comments>http://www.aygfsteel.com/guangcaiwudong/articles/392876.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/guangcaiwudong/comments/commentRss/392876.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/guangcaiwudong/services/trackbacks/392876.html</trackback:ping><description><![CDATA[<div><p>Richfaces鎸夐挳浜嬩歡鎵ц鐨勯『搴忥紝濡備笅榪欐鏍囩浠g爜錛?/p> <p> </p> <div class="wmqeeuq" id=""><div><div>Java浠g爜  </div></div><ol start="1"><li><span><a4j:commandButton  </span></li><li>      action=<span>"#{XXX.action4}"  </span></li><li>      actionListener=<span>"#{XXX.action1}"  </span></li><li>      oncomplete=<span>""  </span></li><li>      reRender=<span>"" >  </span></li><li>      <f:actionListener binding=<span>"#{XXX.action2}" />  </span></li><li>      <f:actionListener binding=<span>"#{XXX.action3}" />  </span></li><li></a4j:commandButton>  </li></ol></div> <p>榪欎釜button鏄瘮杈冨父瑙佺殑錛岄噷闈㈡湁action錛宎ctionListener錛宱ncomplete錛宺eRender涓浜涗簨浠訛紝鎴戜滑浜嗚В榪欎簺浜嬩歡鐨勬墽琛岄『搴忓拰鏈哄埗鏈夊姪浜庢垜浠繘涓姝ョ殑娓呮鐢ㄦ硶錛屾垜綆鍗曠殑璇翠笅浜嗭細</p> <p> </p> <p>button涓婄殑actionListener浜嬩歡鍏堟墽琛岋紝浣嗚繖閲屾敞鍏ヤ簡f:actionListener 錛屽厛鎵цbutton鑷甫鐨刟ctionListener錛岀劧鍚庢寜欏哄簭鎵ц娉ㄥ叆f:actionListener</p> <p>actionListener鎵ц瀹屽悗錛屾帴涓嬫潵鎵цaction</p> <p>action鎵ц瀹屽悗錛岀劧鍚庢墽琛宺eRender浜嬩歡錛堢敤鏉ラ噸娓叉煋涓浜涙爣絳撅級</p> <p>reRender鎵ц瀹屽悗錛屾渶鍚庢墽琛宱ncomplete浜嬩歡錛圝S浜嬩歡錛?/p> <p> </p> <p>緇間笂鎵榪幫紝鎴戜滑鎵ц鐨勯『搴忔槸錛歛ction1錛宎ction2錛宎ction3錛宎ction4錛宺eRender錛宱ncomplete</p><p><br /></p><p> </p><div>鎽樿嚜http://xiaojianbo.iteye.com/blog/1527258</div><p> </p></div><img src ="http://www.aygfsteel.com/guangcaiwudong/aggbug/392876.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/guangcaiwudong/" target="_blank">Kevin_YK</a> 2012-12-12 15:46 <a href="http://www.aygfsteel.com/guangcaiwudong/articles/392876.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> 主站蜘蛛池模板: <a href="http://" target="_blank">溧水县</a>| <a href="http://" target="_blank">尚志市</a>| <a href="http://" target="_blank">桦川县</a>| <a href="http://" target="_blank">田东县</a>| <a href="http://" target="_blank">墨竹工卡县</a>| <a href="http://" target="_blank">建水县</a>| <a href="http://" target="_blank">武川县</a>| <a href="http://" target="_blank">盐源县</a>| <a href="http://" target="_blank">平利县</a>| <a href="http://" target="_blank">洮南市</a>| <a href="http://" target="_blank">岑巩县</a>| <a href="http://" target="_blank">晋城</a>| <a href="http://" target="_blank">崇礼县</a>| <a href="http://" target="_blank">南乐县</a>| <a href="http://" target="_blank">漯河市</a>| <a href="http://" target="_blank">陇西县</a>| <a href="http://" target="_blank">墨竹工卡县</a>| <a href="http://" target="_blank">宝鸡市</a>| <a href="http://" target="_blank">贞丰县</a>| <a href="http://" target="_blank">南川市</a>| <a href="http://" target="_blank">新乡县</a>| <a href="http://" target="_blank">武陟县</a>| <a href="http://" target="_blank">龙江县</a>| <a href="http://" target="_blank">循化</a>| <a href="http://" target="_blank">阜城县</a>| <a href="http://" target="_blank">怀安县</a>| <a href="http://" target="_blank">上思县</a>| <a href="http://" target="_blank">郎溪县</a>| <a href="http://" target="_blank">宽城</a>| <a href="http://" target="_blank">桑植县</a>| <a href="http://" target="_blank">辽宁省</a>| <a href="http://" target="_blank">什邡市</a>| <a href="http://" target="_blank">嘉兴市</a>| <a href="http://" target="_blank">会东县</a>| <a href="http://" target="_blank">和平区</a>| <a href="http://" target="_blank">武宁县</a>| <a href="http://" target="_blank">石台县</a>| <a href="http://" target="_blank">柳州市</a>| <a href="http://" target="_blank">邳州市</a>| <a href="http://" target="_blank">常熟市</a>| <a href="http://" target="_blank">石首市</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>