锘??xml version="1.0" encoding="utf-8" standalone="yes"?>午夜在线亚洲男人午在线,亚洲中文字幕无码一区二区三区,亚洲色欲色欲www在线播放http://www.tkk7.com/hhhaaawwwkkk/category/34837.html澶х埛鐨勫茍TM楠備漢zh-cnTue, 21 Aug 2012 09:32:05 GMTTue, 21 Aug 2012 09:32:05 GMT60js浠son褰㈠紡鎻愪氦鏁版嵁錛屽悗鍙版帴鍙?/title><link>http://www.tkk7.com/hhhaaawwwkkk/archive/2012/08/21/385910.html</link><dc:creator>鐢熷懡鐨勭喚鏀?/dc:creator><author>鐢熷懡鐨勭喚鏀?/author><pubDate>Tue, 21 Aug 2012 02:09:00 GMT</pubDate><guid>http://www.tkk7.com/hhhaaawwwkkk/archive/2012/08/21/385910.html</guid><wfw:comment>http://www.tkk7.com/hhhaaawwwkkk/comments/385910.html</wfw:comment><comments>http://www.tkk7.com/hhhaaawwwkkk/archive/2012/08/21/385910.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/hhhaaawwwkkk/comments/commentRss/385910.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/hhhaaawwwkkk/services/trackbacks/385910.html</trackback:ping><description><![CDATA[<div><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->$("#savename").click(<span style="color: #0000FF; ">function</span>(){<br />    <span style="color: #0000FF; ">var</span> fananname=$("#editname").val();<br />    <span style="color: #0000FF; ">var</span> jsonList = eval(createArray()); <br />    <span style="color: #0000FF; ">var</span> jsonText = JSON.stringify(jsonList);<br />    $.ajax({<br />        type: "POST",<br />        url: "/shop/ffselect!saveAttachedUrl.action",<br />        dataType:"json",<br />        data: {<br />            "fanan":fananname,<br />            "jsonarray":jsonText<br />        },<br />            success: <span style="color: #0000FF; ">function</span>(data) {<br />            <span style="color: #0000FF; ">if</span>(data.status=="success"){<br />                window.location.href="www.baidu.com";<br />            }<br />            },<br />    });    <br />    <br />})<br /><br /><span style="color: #0000FF; ">function</span> createArray(){<br />    <span style="color: #0000FF; ">var</span> jsonarray=[];<br />    <span style="color: #0000FF; ">var</span> fanganid=$("#selectTitleid").val();<br />    <span style="color: #0000FF; ">var</span> $goodsurl=$(".goodsurl");<br />    <span style="color: #0000FF; ">var</span> $isadd=$(".isadd");<br />    <span style="color: #0000FF; ">var</span> $review=$(".inputtextarea");<br />    <span style="color: #0000FF; ">var</span> $isclear=$(".isclear");<br />    <br />    $.each($goodsurl,<span style="color: #0000FF; ">function</span>(n){<br />        <span style="color: #0000FF; ">var</span> goodsurl=$($goodsurl[n]).val();<br />        <span style="color: #0000FF; ">var</span> isadd=$($isadd[n]).val();    <br />        <span style="color: #0000FF; ">var</span> review=$($review[n]).val();<br />        <span style="color: #0000FF; ">var</span> isclear=$($isclear[n]).val();<br />        <span style="color: #0000FF; ">var</span> obj=createObj(goodsurl,isadd,fanganid,review,isclear);<br />        jsonarray.push(obj);<br />    })<br />    <span style="color: #0000FF; ">return</span> jsonarray;<br />}<br /><br /><span style="color: #0000FF; ">function</span> createObj(urlval,isaddval,faidval,reviewval,isclearval){<br />    <span style="color: #0000FF; ">return</span> {<br />        url:urlval,<br />        isadd:isaddval,<br />        faid:faidval,<br />        review:reviewval,<br />        isclear:isclearval<br />    }<br />}<br /></div></div><div><div><div><br /><br />鍚庡彴鎺ュ彈<span style="font-size: 13px; color: #008080; "> 1</span><span style="background-color: #eeeeee; font-size: 13px; "> </span><span style="font-size: 13px; color: #0000ff; ">public</span><span style="background-color: #eeeeee; font-size: 13px; "> String saveAttachedUrl(){</span></div><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><span style="color: #008080; "> 2</span>         LlSelectAttachedUrl attacheURL = <span style="color: #0000FF; ">new</span> LlSelectAttachedUrl();<br /><span style="color: #008080; "> 3</span>         String fanan = getParameter("fanan");<br /><span style="color: #008080; "> 4</span>         String jsonarray = getParameter("jsonarray");<br /><span style="color: #008080; "> 5</span>         System.out.println(fanan);<br /><span style="color: #008080; "> 6</span>         System.out.println(jsonarray);<br /><span style="color: #008080; "> 7</span> <span style="color: #008000; ">//</span><span style="color: #008000; ">        String str = "[{'name':'寮犱笁','sex':'鐢?},{'name':'鏉庡洓','sex':'濂?},{'name':'鐜嬩簲','sex':'鐢?}]";</span><span style="color: #008000; "><br /></span><span style="color: #008080; "> 8</span> <span style="color: #008000; "></span>        JSONArray json = JSONArray.fromObject(jsonarray);<br /><span style="color: #008080; "> 9</span>         <span style="color: #0000FF; ">int</span> size = json.size();<br /><span style="color: #008080; ">10</span>         <span style="color: #0000FF; ">for</span>(<span style="color: #0000FF; ">int</span> i = 0; i<size; i++){<br /><span style="color: #008080; ">11</span>             String re = json.getString(i);<br /><span style="color: #008080; ">12</span>             JSONObject s = JSONObject.fromObject(re);<br /><span style="color: #008080; ">13</span>             attacheURL.setAdd_date(<span style="color: #0000FF; ">new</span> Date());<br /><span style="color: #008080; ">14</span>             attacheURL.setComments(s.getString(""));<br /><span style="color: #008080; ">15</span>             attacheURL.setGoods_url(s.getString(""));<br /><span style="color: #008080; ">16</span>             attacheURL.setId(re);<br /><span style="color: #008080; ">17</span>             attacheURL.setRemark(s.getString(""));<br /><span style="color: #008080; ">18</span>             attacheURL.setSelect_title_id(s.getString(""));<br /><span style="color: #008080; ">19</span>             <span style="color: #0000FF; ">if</span>(s.getString("")!=<span style="color: #0000FF; ">null</span>){<br /><span style="color: #008080; ">20</span>                 attacheURL.setIsAddUrl(Integer.parseInt(s.getString("")));<br /><span style="color: #008080; ">21</span>             }<span style="color: #0000FF; ">if</span>(s.getString("")!=<span style="color: #0000FF; ">null</span>){<br /><span style="color: #008080; ">22</span>                 attacheURL.setState(Integer.parseInt(s.getString("")));<br /><span style="color: #008080; ">23</span>             }<br /><span style="color: #008080; ">24</span>             <span style="color: #0000FF; ">this</span>.selectFanFan.saveSelectAttachedUrl(attacheURL);<br /><span style="color: #008080; ">25</span>         }<br /><span style="color: #008080; ">26</span>         <span style="color: #0000FF; ">return</span> ajax(Status.success);<br /><span style="color: #008080; ">27</span>     }</div></div></div><img src ="http://www.tkk7.com/hhhaaawwwkkk/aggbug/385910.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/hhhaaawwwkkk/" target="_blank">鐢熷懡鐨勭喚鏀?/a> 2012-08-21 10:09 <a href="http://www.tkk7.com/hhhaaawwwkkk/archive/2012/08/21/385910.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Struts2 浣跨敤annotation浠巃ction璺寵漿鍒癮ction騫朵紶閫掑弬鏁?/title><link>http://www.tkk7.com/hhhaaawwwkkk/archive/2012/02/16/370135.html</link><dc:creator>鐢熷懡鐨勭喚鏀?/dc:creator><author>鐢熷懡鐨勭喚鏀?/author><pubDate>Thu, 16 Feb 2012 09:55:00 GMT</pubDate><guid>http://www.tkk7.com/hhhaaawwwkkk/archive/2012/02/16/370135.html</guid><wfw:comment>http://www.tkk7.com/hhhaaawwwkkk/comments/370135.html</wfw:comment><comments>http://www.tkk7.com/hhhaaawwwkkk/archive/2012/02/16/370135.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.tkk7.com/hhhaaawwwkkk/comments/commentRss/370135.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/hhhaaawwwkkk/services/trackbacks/370135.html</trackback:ping><description><![CDATA[MyAction.java<br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; ">package</span><span style="color: #000000; "> com.zzn.action;<br /><br /></span><span style="color: #0000FF; ">import</span><span style="color: #000000; "> org.apache.struts2.convention.annotation.Result;<br /></span><span style="color: #0000FF; ">import</span><span style="color: #000000; "> org.apache.struts2.convention.annotation.Results;<br /><br /></span><span style="color: #0000FF; ">import</span><span style="color: #000000; "> com.opensymphony.xwork2.ActionSupport;<br /><br />@Results(<br />    {<br />        @Result(name</span><span style="color: #000000; ">=</span><span style="color: #000000; ">"</span><span style="color: #000000; ">aaaa</span><span style="color: #000000; ">"</span><span style="color: #000000; ">,location</span><span style="color: #000000; ">=</span><span style="color: #000000; ">"</span><span style="color: #000000; ">aaaa!aaaa.action</span><span style="color: #000000; ">"</span><span style="color: #000000; ">,type</span><span style="color: #000000; ">=</span><span style="color: #000000; ">"</span><span style="color: #000000; ">redirect</span><span style="color: #000000; ">"</span><span style="color: #000000; ">,<br />                params </span><span style="color: #000000; ">=</span><span style="color: #000000; "> {</span><span style="color: #000000; ">"</span><span style="color: #000000; ">flag</span><span style="color: #000000; ">"</span><span style="color: #000000; ">,</span><span style="color: #000000; ">"</span><span style="color: #000000; ">${flag}</span><span style="color: #000000; ">"</span><span style="color: #000000; ">,</span><span style="color: #000000; ">"</span><span style="color: #000000; ">flag2</span><span style="color: #000000; ">"</span><span style="color: #000000; ">,</span><span style="color: #000000; ">"</span><span style="color: #000000; ">${flag2}</span><span style="color: #000000; ">"</span><span style="color: #000000; ">}),<br />        @Result(name</span><span style="color: #000000; ">=</span><span style="color: #000000; ">"</span><span style="color: #000000; ">bbbb</span><span style="color: #000000; ">"</span><span style="color: #000000; ">,location</span><span style="color: #000000; ">=</span><span style="color: #000000; ">"</span><span style="color: #000000; ">bbbb!bbbb.action</span><span style="color: #000000; ">"</span><span style="color: #000000; ">,type</span><span style="color: #000000; ">=</span><span style="color: #000000; ">"</span><span style="color: #000000; ">redirect</span><span style="color: #000000; ">"</span><span style="color: #000000; ">,<br />                params </span><span style="color: #000000; ">=</span><span style="color: #000000; "> {</span><span style="color: #000000; ">"</span><span style="color: #000000; ">flag</span><span style="color: #000000; ">"</span><span style="color: #000000; ">,</span><span style="color: #000000; ">"</span><span style="color: #000000; ">${flag}</span><span style="color: #000000; ">"</span><span style="color: #000000; ">,</span><span style="color: #000000; ">"</span><span style="color: #000000; ">flag2</span><span style="color: #000000; ">"</span><span style="color: #000000; ">,</span><span style="color: #000000; ">"</span><span style="color: #000000; ">${flag2}</span><span style="color: #000000; ">"</span><span style="color: #000000; ">}<br />                )<br />    }<br />)<br /></span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">class</span><span style="color: #000000; "> MyAction </span><span style="color: #0000FF; ">extends</span><span style="color: #000000; "> ActionSupport{<br />    </span><span style="color: #0000FF; ">private</span><span style="color: #000000; "> String flag ;<br />    </span><span style="color: #0000FF; ">private</span><span style="color: #000000; "> String flag2;<br /><br />    </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> String jump(){<br />        </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">(flag</span><span style="color: #000000; ">!=</span><span style="color: #0000FF; ">null</span><span style="color: #000000; ">&&</span><span style="color: #000000; ">flag.equals(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">aaaa</span><span style="color: #000000; ">"</span><span style="color: #000000; ">)){<br />            </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> </span><span style="color: #000000; ">"</span><span style="color: #000000; ">aaaa</span><span style="color: #000000; ">"</span><span style="color: #000000; ">;<br />        }</span><span style="color: #0000FF; ">else</span><span style="color: #000000; ">{<br />            </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> </span><span style="color: #000000; ">"</span><span style="color: #000000; ">bbbb</span><span style="color: #000000; ">"</span><span style="color: #000000; ">;<br />        }<br />    }<br />    <br />    </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> String getFlag() {<br />        </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> flag;<br />    }<br /><br />    </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> setFlag(String flag) {<br />        </span><span style="color: #0000FF; ">this</span><span style="color: #000000; ">.flag </span><span style="color: #000000; ">=</span><span style="color: #000000; "> flag;<br />    }<br /><br /><br />    </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> String getFlag2() {<br />        </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> flag2;<br />    }<br /><br /><br />    </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> setFlag2(String flag2) {<br />        </span><span style="color: #0000FF; ">this</span><span style="color: #000000; ">.flag2 </span><span style="color: #000000; ">=</span><span style="color: #000000; "> flag2;<br />    }<br /><br />}<br /></span></div><br /><div><span style="color: #000000; ">AaaaAction.java<br /></span></div><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; ">package</span><span style="color: #000000; "> com.zzn.action;<br /><br /></span><span style="color: #0000FF; ">import</span><span style="color: #000000; "> com.opensymphony.xwork2.ActionSupport;<br /><br /></span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">class</span><span style="color: #000000; "> AaaaAction </span><span style="color: #0000FF; ">extends</span><span style="color: #000000; "> ActionSupport {<br />    <br />    </span><span style="color: #0000FF; ">private</span><span style="color: #000000; "> String flag;<br />    </span><span style="color: #0000FF; ">private</span><span style="color: #000000; "> String flag2;<br />    <br />    </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> String aaaa(){<br />        System.out.println(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">鎴戣皟鐢ㄧ殑aaaa鏂規(guī)硶</span><span style="color: #000000; ">"</span><span style="color: #000000; ">+</span><span style="color: #000000; ">flag</span><span style="color: #000000; ">+</span><span style="color: #000000; ">"</span><span style="color: #000000; ">~~~~~</span><span style="color: #000000; ">"</span><span style="color: #000000; ">+</span><span style="color: #000000; ">flag2);<br />        </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> </span><span style="color: #000000; ">"</span><span style="color: #000000; ">page</span><span style="color: #000000; ">"</span><span style="color: #000000; ">;<br />    }<br />    <br />    </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> String getFlag() {<br />        </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> flag;<br />    }<br /><br />    </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> setFlag(String flag) {<br />        </span><span style="color: #0000FF; ">this</span><span style="color: #000000; ">.flag </span><span style="color: #000000; ">=</span><span style="color: #000000; "> flag;<br />    }<br /><br />    </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> String getFlag2() {<br />        </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> flag2;<br />    }<br /><br />    </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> setFlag2(String flag2) {<br />        </span><span style="color: #0000FF; ">this</span><span style="color: #000000; ">.flag2 </span><span style="color: #000000; ">=</span><span style="color: #000000; "> flag2;<br />    }<br />}<br /></span></div><br /><div><span style="color: #000000; ">BbbbAction.java<br /></span></div><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; ">package</span><span style="color: #000000; "> com.zzn.action;<br /><br /></span><span style="color: #0000FF; ">import</span><span style="color: #000000; "> com.opensymphony.xwork2.ActionSupport;<br /><br /></span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">class</span><span style="color: #000000; "> BbbbAction </span><span style="color: #0000FF; ">extends</span><span style="color: #000000; "> ActionSupport {<br />    </span><span style="color: #0000FF; ">private</span><span style="color: #000000; "> String flag;<br />    </span><span style="color: #0000FF; ">private</span><span style="color: #000000; "> String flag2;<br />    <br /><br />    </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> String bbbb(){<br />        System.out.println(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">鎴戣皟鐢ㄧ殑bbb鏂規(guī)硶</span><span style="color: #000000; ">"</span><span style="color: #000000; ">+</span><span style="color: #000000; ">flag);<br />        </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> </span><span style="color: #000000; ">"</span><span style="color: #000000; ">page</span><span style="color: #000000; ">"</span><span style="color: #000000; ">;<br />    }<br />    <br />    </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> String getFlag() {<br />        </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> flag;<br />    }<br /><br />    </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> setFlag(String flag) {<br />        </span><span style="color: #0000FF; ">this</span><span style="color: #000000; ">.flag </span><span style="color: #000000; ">=</span><span style="color: #000000; "> flag;<br />    }<br />    <br />    </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> String getFlag2() {<br />        </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> flag2;<br />    }<br /><br />    </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> setFlag2(String flag2) {<br />        </span><span style="color: #0000FF; ">this</span><span style="color: #000000; ">.flag2 </span><span style="color: #000000; ">=</span><span style="color: #000000; "> flag2;<br />    }<br />}<br /></span></div><br /><br /><img src ="http://www.tkk7.com/hhhaaawwwkkk/aggbug/370135.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/hhhaaawwwkkk/" target="_blank">鐢熷懡鐨勭喚鏀?/a> 2012-02-16 17:55 <a href="http://www.tkk7.com/hhhaaawwwkkk/archive/2012/02/16/370135.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>struts2瀛︿範(fàn)絎旇錛堝叚錛?-OGNLhttp://www.tkk7.com/hhhaaawwwkkk/archive/2011/12/11/366097.html鐢熷懡鐨勭喚鏀?/dc:creator>鐢熷懡鐨勭喚鏀?/author>Sun, 11 Dec 2011 08:07:00 GMThttp://www.tkk7.com/hhhaaawwwkkk/archive/2011/12/11/366097.htmlhttp://www.tkk7.com/hhhaaawwwkkk/comments/366097.htmlhttp://www.tkk7.com/hhhaaawwwkkk/archive/2011/12/11/366097.html#Feedback0http://www.tkk7.com/hhhaaawwwkkk/comments/commentRss/366097.htmlhttp://www.tkk7.com/hhhaaawwwkkk/services/trackbacks/366097.html浠庨〉闈紶閫掔粰action鍊紆sername涓巔assword銆?br />action鍐欐硶錛?br />
public class OgnlAction extends ActionSupport {

    
private String username;
    
    
private String password;

    
public String execute() {
        
return SUCCESS;
    }

    
public String getPassword() {
        
return password;
    }
    
    
public String getUsername() {
        
return username;
    }

    
public void setPassword(String password) {
        
this.password = password;
    }

    
public void setUsername(String username) {
        
this.username = username;
    }

}
jsp欏甸潰浣跨敤ognl鑾峰彇username涓巔assword鍊?br />
<li>璁塊棶鍊兼爤涓殑action鐨勬櫘閫氬睘鎬? username = <s:property value="username"/>
password = <s:property value="password"/>
</li>

浜屻佷嬌鐢╱ser.java綾繪潵鎺ュ彈浼犻掓暟鎹?br />user.java
public class User {
    
private int age ;
    
private String username;
    
    
public int getAge() {
        
return age;
    }

    
public String getUsername() {
        
return username;
    }

    
public void setUsername(String username) {
        
this.username = username;
    }

    
public void setAge(int age) {
        
this.age = age;
    }
    
    @Override
    
public String toString() {
        
return "user" + age;
    }
}

欏甸潰浼犻掓暟鎹?br />
<a href="<%=contextPath %>/ognl.action?user.age=2012&user.username=xxxxxxxx">ognl</a>

action鎺ユ敹
public class OgnlAction extends ActionSupport {
    
private User user;

    
public User getUser() {
        
return user;
    }

    
public void setUser(User user) {
        
this.user = user;
    }
    
    
private String excute() {
        
return SUCCESS;
    }
}
浼犻掑埌欏甸潰涓婃樉紺?br />
<s:property value="user.age"/>| <s:property value="user['age']"/> | <s:property value="user[\"age\"]"/>
<s:property value="user.username"/>
榪欓噷鎻愯搗涓涓媜gnl鍦╦sp涓闂產(chǎn)ction鐨勬柟娉曠殑鍐欐硶
<li>璁塊棶鍊兼爤涓璞$殑鏅氭柟娉曪細(xì)<s:property value="password.length()"/></li>
<li>璁塊棶鍊兼爤涓璞$殑鏅氭柟娉曪細(xì)<s:property value="cat.miaomiao()" /></li>
<li>璁塊棶鍊兼爤涓璦ction鐨勬櫘閫氭柟娉曪細(xì)<s:property value="m()" /></li>

ognl鍙互璁塊棶闈欐佹柟娉曘傞渶瑕佸湪struts.xml涓緗?lt;constant name="struts.ognl.allowStaticMethodAccess" value="true"></constant>
<li>璁塊棶闈欐佹柟娉曪細(xì)<s:property value="@com.bjsxt.struts2.ognl.S@s()"/></li>
<li>璁塊棶闈欐佸睘鎬э細(xì)<s:property value="@com.bjsxt.struts2.ognl.S@STR"/></li>
<li>璁塊棶Math綾葷殑闈欐佹柟娉曪細(xì)<s:property value="@@max(2,3)" /></li>

<li>璁塊棶鏅氱被鐨勬瀯閫犳柟娉曪細(xì)<s:property value="new com.bjsxt.struts2.ognl.User(8)"/></li>

ogin璁塊棶闆嗗悎
<li>璁塊棶List:<s:property value="users"/></li>
<li>璁塊棶List涓煇涓厓绱?<s:property value="users[1]"/></li>
<li>璁塊棶List涓厓绱犳煇涓睘鎬х殑闆嗗悎:<s:property value="users.{age}"/></li>
<li>璁塊棶List涓厓绱犳煇涓睘鎬х殑闆嗗悎涓殑鐗瑰畾鍊?<s:property value="users.{age}[0]"/> | <s:property value="users[0].age"/></li>
<li>璁塊棶Set:<s:property value="dogs"/></li>
<li>璁塊棶Set涓煇涓厓绱?<s:property value="dogs[1]"/></li>
<li>璁塊棶Map:<s:property value="dogMap"/></li>
<li>璁塊棶Map涓煇涓厓绱?<s:property value="dogMap.dog101"/> | <s:property value="dogMap['dog101']"/> | <s:property value="dogMap[\"dog101\"]"/></li>
<li>璁塊棶Map涓墍鏈夌殑key:<s:property value="dogMap.keys"/></li>
<li>璁塊棶Map涓墍鏈夌殑value:<s:property value="dogMap.values"/></li>
<li>璁塊棶瀹瑰櫒鐨勫ぇ灝忥細(xì)<s:property value="dogMap.size()"/> | <s:property value="users.size"/> </li>

<li>鎶曞獎(jiǎng)(榪囨護(hù))錛?lt;s:property value="users.{?#this.age==1}[0]"/></li>
<li>鎶曞獎(jiǎng)錛?lt;s:property value="users.{^#this.age>1}.{age}"/></li><!-- age>1闆嗗悎涓紑澶寸殑涓涓?--><li>
鎶曞獎(jiǎng)錛?lt;s:property value="users.{$#this.age>1}.{age}"/></li><!-- age>1闆嗗悎涓粨灝劇殑涓涓?--><li>
鎶曞獎(jiǎng)錛?lt;s:property value="users.{$#this.age>1}.{age} == null"/></li><!-- 鑾峰彇鐨勯泦鍚堟槸鍚︿負(fù)絀?nbsp; -->




]]>
struts2瀛︿範(fàn)絎旇錛堜簲錛?-result榪斿洖鍊肩殑鍏朵粬鐢ㄦ硶http://www.tkk7.com/hhhaaawwwkkk/archive/2011/12/11/366094.html鐢熷懡鐨勭喚鏀?/dc:creator>鐢熷懡鐨勭喚鏀?/author>Sun, 11 Dec 2011 05:23:00 GMThttp://www.tkk7.com/hhhaaawwwkkk/archive/2011/12/11/366094.htmlhttp://www.tkk7.com/hhhaaawwwkkk/comments/366094.htmlhttp://www.tkk7.com/hhhaaawwwkkk/archive/2011/12/11/366094.html#Feedback0http://www.tkk7.com/hhhaaawwwkkk/comments/commentRss/366094.htmlhttp://www.tkk7.com/hhhaaawwwkkk/services/trackbacks/366094.html 絎竴縐峳esult榪斿洖鍊兼柟娉?br /> struts.xml涓殑閰嶇疆濡備笅錛?br />
<struts>
    
<constant name="struts.devMode" value="true" />
    
<package name="user" namespace="/user" extends="struts-default">
        
        
<action name="user" class="com.bjsxt.struts2.user.action.UserAction">
            
<result>${r}</result>
        
</action>        
    
</package>
        
</struts>
action鐨勫啓娉曪細(xì)
public class UserAction extends ActionSupport {
    
private int type;
    
    
private String r;

    
public String getR() {
        
return r;
    }

    
public void setR(String r) {
        
this.r = r;
    }

    
public int getType() {
        
return type;
    }

    
public void setType(int type) {
        
this.type = type;
    }

    @Override
    
public String execute() throws Exception {
        
if(type == 1) r="/user_success.jsp";
        
else if (type == 2) r="/user_error.jsp";
        
return "success";
    }

}

絎簩縐峳esult榪斿洖鍊兼柟娉?br />
struts.xml涓殑閰嶇疆濡備笅錛岃繖縐嶆柟娉曞彲浠ユ妸type鍊間紶閫掑埌欏甸潰涓幓銆傚湪欏甸潰涓彲浠ユ笭閬搕ype鐨勫鹼紝<s:property value="#parameters.t">
<struts>
    
<constant name="struts.devMode" value="true" />
    
<package name="user" namespace="/user" extends="struts-default">
        
        
<action name="user" class="com.bjsxt.struts2.user.action.UserAction">
            
<result type="redirect">/user_success.jsp?t=${type}</result>
        
</action>        
    
</package>
        
</struts>
action鐨勫啓娉曪細(xì)

public class UserAction extends ActionSupport {
    
private int type;
    
    
public int getType() {
        
return type;
    }

    
public void setType(int type) {
        
this.type = type;
    }

    @Override
    
public String execute() throws Exception {
        
return "success";
    }

}



]]>
struts2瀛︿範(fàn)絎旇錛堜簩錛?-Conversion-plugin瀹炵幇闆墮厤楗?/title><link>http://www.tkk7.com/hhhaaawwwkkk/archive/2011/12/10/365679.html</link><dc:creator>鐢熷懡鐨勭喚鏀?/dc:creator><author>鐢熷懡鐨勭喚鏀?/author><pubDate>Sat, 10 Dec 2011 04:52:00 GMT</pubDate><guid>http://www.tkk7.com/hhhaaawwwkkk/archive/2011/12/10/365679.html</guid><wfw:comment>http://www.tkk7.com/hhhaaawwwkkk/comments/365679.html</wfw:comment><comments>http://www.tkk7.com/hhhaaawwwkkk/archive/2011/12/10/365679.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/hhhaaawwwkkk/comments/commentRss/365679.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/hhhaaawwwkkk/services/trackbacks/365679.html</trackback:ping><description><![CDATA[棣栧厛鎰熻阿http://www.cnblogs.com/MoShin/archive/2011/04/06/2006591.html緇欑殑榪欎箞璇︾粏鐨勮瑙c?br /><div>濡備綍浣跨敤Convention錛堢害瀹氾級灝唖truts-Convention-plugin-2.1.6.jar鏂囦歡澶嶅埗鍒癢EB-INF/lib璺緞涓?/div><br /><div><div>闆墮厤緗茍涓嶆槸娌℃湁閰嶇疆錛岃屾槸閫氳繃綰﹀畾澶т簬閰嶇疆鐨勬柟寮忥紝澶ч噺閫氳繃綰﹀畾鏉ヨ皟搴﹂〉闈㈢殑璺寵漿鑰屼嬌寰楅厤緗ぇ澶у噺灝戙傛墍浠ワ紝棣栧厛搴旇浜嗚В涓媍onvention-plugin鐨勭害瀹氾細(xì)<br /> 1. 榛樿鎵鏈夌殑緇撴灉欏甸潰閮藉瓨鍌ㄥ湪WEB-INF/content涓嬶紝浣犲彲浠ラ氳繃璁劇疆struts.convention.result.path榪欎釜灞炴х殑鍊兼潵鏀瑰彉鍒板叾浠栬礬寰勩傚錛?/div><div><div><span style="color: #000000;"> </span><span style="color: #000000;"><br /></span><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; ">1</span> <span style="color: #000000; ">  </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">constant </span><span style="color: #FF0000; ">name</span><span style="color: #0000FF; ">="struts.convention.result.path"</span><span style="color: #FF0000; "> value</span><span style="color: #0000FF; ">="/WEB-INF/page"</span><span style="color: #FF0000; "> </span><span style="color: #0000FF; ">/></span><span style="color: #000000; ">  <br /></span></div></div></div><p> 鍒欏皢璺緞閰嶇疆鍒頒簡WEB-INF/page 涓嬨?br /></p><p> </p><p> 2. 榛樿鍖呰礬寰勫寘鍚玜ction,actions,struts,struts2鐨勬墍鏈夊寘閮戒細(xì)琚玸truts浣滀負(fù)鍚湁Action綾葷殑璺緞鏉ユ悳绱€?/p><p><div>錛圓錛塁onvention鎻掍歡浼?xì)鎶婂涓嬩袱绉峧ava綾誨綋鎴怉ction澶勭悊錛?br />    1錛?鎵鏈夊疄鐜頒簡com.opensymphony.xwork2.Action鐨刯ava綾匯?br />    2錛?鎵鏈夌被鍚嶄互Action緇撳熬鐨刯ava綾?/div></p><p>錛圔錛変綘涔熷彲浠ラ氳繃璁劇疆struts.convention.package.locators灞炴ф潵淇敼榪欎釜閰嶇疆銆傚錛?span style="color: #0000ff;"><br /></span></p><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; ">1</span> <span style="color: #0000FF; "><</span><span style="color: #800000; ">constant </span><span style="color: #FF0000; ">name</span><span style="color: #0000FF; ">="struts.convention.package.locators"</span><span style="color: #FF0000; "> value</span><span style="color: #0000FF; ">="web,action"</span><span style="color: #FF0000; "> </span><span style="color: #0000FF; ">/></span><span style="color: #000000; "> <br /></span></div><p><span style="color: #000000;"></span></p><div>鍒欏畾涔変簡鍦ㄩ」鐩腑錛屽寘璺緞鍖呭惈web鍜宎ction鐨勫皢琚涓篈ction瀛樺湪鐨勮礬寰勬潵榪涜鎼滅儲(chǔ)銆?br /> Com.ustb.web.*/com.ustb.action.*閮藉皢琚涓哄惈鏈堿ction鐨勫寘璺緞鑰岃鎼滅儲(chǔ)銆?br /><div>struts.Convention.exclude.packges:鎸囧畾涓嶆壂鎻忓摢浜涘寘涓嬬殑java綾伙紝浣嶄簬榪欎簺鍖呯粨鏋勪笅鐨刯ava綾誨皢涓嶄細(xì)鑷姩鏄犲皠鎴怉ction錛?/div><div>錛圕錛塻truts.convention.action.packages:Convention鎻掍歡浠ヨ甯擱噺鎸囧畾鍖呬綔涓烘牴鍖呮潵鎼滅儲(chǔ)Action綾匯侰onvention鎻掍歡闄や簡鎵弿action,actions,struts,struts2鍥涗釜鍖呯殑綾諱互澶栵紝榪樹細(xì)鎵弿璇ュ父閲忔寚瀹氱殑涓涓?nbsp; 鎴栧涓寘錛孋onvention浼?xì)璇曞浘浠庝腑鍙戠幇Action綾匯?br />錛圖錛夋敞鎰忥細(xì)struts.convention.package.locators鍜宻truts.convention.action.packages涓や釜甯擱噺鐨勪綔鐢ㄦ瘮杈冨井濡欙紝寮鍙戣呭湪鍒╃敤榪欎袱涓父閲忔椂鍔″繀灝忓績銆?br />    濡傦細(xì)涓嬮潰Action鎵鍦ㄥ寘琚槧灝勭殑鍛藉悕絀洪棿濡備笅錛?br />    com.fun.actions.LoginAction 鏄犲皠鍒?/<br />    com.fun.actions.myoffice.CarInfoAction 鏄犲皠鍒?/myoffice<br />    com.fun.struts.myoffice.EntINfoAction 鏄犲皠鍒?/myofiice</div></div><div>3. 鎺ョ潃錛孋onvention浠庡墠涓姝ユ壘鍒扮殑package浠ュ強(qiáng)鍏跺瓙package涓鎵?com.opensymphony.xwork2.Action 鐨勫疄鐜頒互鍙?qiáng)浠ction緇撳熬鐨勭被錛?/div><div><div><span style="color: #000000;">   </span><span style="color: #000000;">1</span><span style="color: #000000;">. com.example.actions.MainAction  <br />   </span><span style="color: #000000;">2</span><span style="color: #000000;">. com.example.actions.products.Display (</span><span style="color: #0000ff;">implements</span><span style="color: #000000;"> com.opensymphony.xwork2.Action)  <br />   </span><span style="color: #000000;">3</span><span style="color: #000000;">. com.example.struts.company.details.ShowCompanyDetailsAction  <br /></span></div></div><p> </p><div>4. 鍛藉悕絀洪棿銆備粠瀹氫箟鐨?package.locators鏍囩ず寮濮嬪埌鍖呯粨鏉熺殑閮ㄥ垎錛屽氨鏄懡鍚嶇┖闂淬備婦涓緥瀛愶細(xì)<br />     Com.ustb.web.user.userAction鐨勫懡鍚嶇┖闂存槸錛?#8221;/user”銆侰om.ustb.web.user.detail.UserAction鐨勫懡鍚嶇┖闂存槸錛?#8221;/user/detail”<br /><br /> 5. Convention閫氳繃濡備笅瑙勫垯紜畾URL鐨勫叿浣撹祫婧愰儴鍒?鍘繪帀綾誨悕鐨凙ction閮ㄥ垎銆傜劧鍚庡皢灝嗘瘡涓垎閮ㄧ殑棣栧瓧姣嶈漿涓哄皬鍐欙紝鐢?#8217;-’鍒嗗壊錛屼綘鍙互璁劇疆struts.convention.action.name.separator 濡?</div><div><div><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; ">1</span> <span style="color: #000000; ">    </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">constant </span><span style="color: #FF0000; ">name</span><span style="color: #0000FF; ">="struts.convention.action.name.separator"</span><span style="color: #FF0000; "> value</span><span style="color: #0000FF; ">="-"</span><span style="color: #FF0000; "> </span><span style="color: #0000FF; ">/></span></div><span style="color: #0000ff;"></span></div></div> <div><div>    榪樻槸涓句釜渚嬪瓙錛?br />     UserAction->user  UserDetailAction ->user-detail銆傜粨鍚堜笂闈㈢殑銆傚浜巆om.ustb.web.user.detail.UserDetailAction錛屾槧灝勭殑 url灝辨槸/WEB-INF/content/user/detail/user-detail.jsp<br /><br /> 6. struts鏀寔.jsp .html .htm .vm鏍煎紡鐨勬枃浠躲?br /> 涓嬮潰鏄痑ction鍜岀粨鏋滄ā鐗堢殑鏄犲皠鍏崇郴錛?strong><br /></strong> <table style="height: 130px;" align="left" border="1" width="590"><tbody> <tr> <td> <strong>URL</strong> </td> <td> <strong>Result <br /></strong> </td> <td> <strong>File that could match</strong> </td> <td> <strong>Result Type</strong> </td> </tr> <tr> <td>/hello</td> <td>success</td> <td>/WEB-INF/content/hello.jsp</td> <td>Dispatcher</td> </tr> <tr> <td>/hello</td> <td>success</td> <td>/WEB-INF/content/hello-success.htm </td> <td>Dispatcher</td> </tr> <tr> <td>/hello</td> <td>success</td> <td>/WEB-INF/content/hello.ftl </td> <td> FreeMarker</td> </tr> <tr> <td>/hello-world</td> <td>input</td> <td>/WEB-INF/content/hello-world-input.vm</td> <td>Velocity</td> </tr> <tr> <td>/test1/test2/hello</td> <td>error</td> <td>/WEB-INF/content/test/test2/hello-error.html</td> <td>Dispatcher</td> </tr> </tbody></table> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p><p> </p><p>褰撶劧錛岀畝鍗曠殑閫氳繃榛樿鐨勬柟寮忔潵榪涜閰嶇疆涓嶈兘瀹屽叏婊¤凍瀹為檯欏圭洰鐨勯渶瑕併傛墍騫革紝convention鐨勯浂閰嶇疆鏄潪甯哥伒媧葷殑銆?br /><strong>閫氳繃@Action娉ㄩ噴</strong> <br /> 瀵瑰涓嬩緥瀛愶細(xì)</p><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; "> 1</span> <span style="color: #0000FF; ">import</span><span style="color: #000000; "> com.opensymphony.xwork2.Action;<br /></span><span style="color: #008080; "> 2</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">import</span><span style="color: #000000; "> com.opensymphony.xwork2.ActionSupport;<br /></span><span style="color: #008080; "> 3</span> <span style="color: #000000; "><br /></span><span style="color: #008080; "> 4</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">class</span><span style="color: #000000; "> HelloAction </span><span style="color: #0000FF; ">extends</span><span style="color: #000000; "> ActionSupport {<br /></span><span style="color: #008080; "> 5</span> <span style="color: #000000; ">    @Action(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">action1</span><span style="color: #000000; ">"</span><span style="color: #000000; ">)<br /></span><span style="color: #008080; "> 6</span> <span style="color: #000000; ">    </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> String method1() {<br /></span><span style="color: #008080; "> 7</span> <span style="color: #000000; ">        </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> SUCCESS;<br /></span><span style="color: #008080; "> 8</span> <span style="color: #000000; ">    }<br /></span><span style="color: #008080; "> 9</span> <span style="color: #000000; "><br /></span><span style="color: #008080; ">10</span> <span style="color: #000000; ">    @Action(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">/user/action2</span><span style="color: #000000; ">"</span><span style="color: #000000; ">)<br /></span><span style="color: #008080; ">11</span> <span style="color: #000000; ">    </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> String method2() {<br /></span><span style="color: #008080; ">12</span> <span style="color: #000000; ">        </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> SUCCESS;<br /></span><span style="color: #008080; ">13</span> <span style="color: #000000; ">    }<br /></span><span style="color: #008080; ">14</span> <span style="color: #000000; ">}</span></div></div><div><div><span style="color: #000000;"></span><span style="color: #000000;"></span><span style="color: #000000;"></span><span style="color: #0000ff;"></span><span style="color: #000000;"><br /></span></div></div></div><div><table style="height: 65px;" border="0" width="640"><tbody><tr><td><strong>鏂規(guī)硶鍚?/strong> </td> <td> <strong>榛樿璋冪敤璺緞</strong> </td> <td> <strong>榛樿鏄犲皠璺緞</strong> </td> </tr> <tr> <td> <span style="font-size: small;">method1</span> </td> <td> <span style="font-size: small;">/hello!method1.action .</span> </td> <td> <span style="font-size: small;">/WEB-INF/content/hello.jsp</span> </td> </tr> <tr> <td> <span style="font-size: small;">method2</span> </td> <td> <span style="font-size: small;">/hello!method2.action.</span> </td> <td> <span style="font-size: small;">/WEB-INF/content/hello.jsp</span> </td> </tr> </tbody></table> <p><span style="color: #ff6600;"><span style="text-decoration: underline;">閫氳繃@Action娉ㄩ噴鍚?/span> </span> </p> <table style="height: 64px;" border="0" width="639"><tbody> <tr> <td> <strong>鏂規(guī)硶鍚?/strong> </td> <td> <strong>@Action娉ㄩ噴鍚庤皟鐢ㄨ礬寰?/strong> </td> <td> <strong>@Action娉ㄩ噴</strong> <strong>鍚庢槧灝勮礬寰?/strong> </td> </tr> <tr> <td> <span style="font-size: small;">method1</span> </td> <td> <span style="font-size: small;">/action1!method1.action.</span> </td> <td> <span style="font-size: small;">/WEB-INF/content/action1.jsp</span> </td> </tr> <tr> <td> <span style="font-size: small;">method1</span> </td> <td> <span style="font-size: small;">/user/action2!method2.action</span> </td> <td> <span style="font-size: small;">/WEB-INF/content/user/action2.jsp</span> </td> </tr> </tbody></table> <p><br /><strong>閫氳繃@Actions娉ㄩ噴</strong> </p></div><div><div><span style="color: #000000;"></span><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; "> 1</span> <span style="color: #0000FF; ">import</span><span style="color: #000000; "> com.opensymphony.xwork2.ActionSupport;   <br /></span><span style="color: #008080; "> 2</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">import</span><span style="color: #000000; "> org.apache.struts2.convention.annotation.Action;  <br /></span><span style="color: #008080; "> 3</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">import</span><span style="color: #000000; "> org.apache.struts2.convention.annotation.Actions;  <br /></span><span style="color: #008080; "> 4</span> <span style="color: #000000; "> <br /></span><span style="color: #008080; "> 5</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">class</span><span style="color: #000000; "> HelloAction </span><span style="color: #0000FF; ">extends</span><span style="color: #000000; "> ActionSupport {  <br /></span><span style="color: #008080; "> 6</span> <span style="color: #000000; ">    @Actions({  <br /></span><span style="color: #008080; "> 7</span> <span style="color: #000000; ">     @Action(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">/different/url</span><span style="color: #000000; ">"</span><span style="color: #000000; ">),  <br /></span><span style="color: #008080; "> 8</span> <span style="color: #000000; ">     @Action(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">/another/url</span><span style="color: #000000; ">"</span><span style="color: #000000; ">)  <br /></span><span style="color: #008080; "> 9</span> <span style="color: #000000; ">   })  <br /></span><span style="color: #008080; ">10</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> String method1() {  <br /></span><span style="color: #008080; ">11</span> <span style="color: #000000; ">   </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> “error”;  <br /></span><span style="color: #008080; ">12</span> <span style="color: #000000; ">} <br /></span></div>  </div></div><div>鎴戜滑鍙互閫氳繃錛?span style="font-size: medium;"><strong><span style="color: #008000;"><span style="color: #0000ff;"><span style="font-size: small;"><em>/different/url!method1.action</em> </span> </span> </span> </strong> 鎴?/span> <span style="color: #008000; font-size: small;"><strong><span style="font-size: medium;"><span style="color: #0000ff;"><span style="font-size: small;"><em>/another/url!method1.action</em> </span> </span> </span> </strong> </span> 鏉ヨ皟鐢?strong>method1</strong> 鏂規(guī)硶銆?br /> 瀵瑰簲鐨勬槧灝勮礬寰勫垎鍒槸<strong><span style="color: #0000ff; font-size: small;"><em>/WEB-INF/content/different/url-error.jsp; /WEB-INF/content/another/url-error.jsp</em> </span> <br /></strong> <br /> 鍙兘璇浜嗗ぇ瀹訛紝涓涓柟娉曡@Action娉ㄩ噴鍚庯紝鍙槸澶氫簡涓縐嶈皟鐢ㄦ柟寮忥紝鑰屼笉鏄瑕嗙洊浜嗗師鏉ョ殑璋冪敤鏂瑰紡銆傛瘮濡傚浜庡涓嬩緥瀛愶細(xì)</div><div><div><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; "> 1</span> <span style="color: #0000FF; ">import</span><span style="color: #000000; "> com.opensymphony.xwork2.ActionSupport;   <br /></span><span style="color: #008080; "> 2</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">import</span><span style="color: #000000; "> org.apache.struts2.convention.annotation.Action;  <br /></span><span style="color: #008080; "> 3</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">import</span><span style="color: #000000; "> org.apache.struts2.convention.annotation.Actions;  <br /></span><span style="color: #008080; "> 4</span> <span style="color: #000000; ">   <br /></span><span style="color: #008080; "> 5</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">class</span><span style="color: #000000; "> HelloAction </span><span style="color: #0000FF; ">extends</span><span style="color: #000000; "> ActionSupport {  <br /></span><span style="color: #008080; "> 6</span> <span style="color: #000000; ">   @Action(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">/another/url</span><span style="color: #000000; ">"</span><span style="color: #000000; ">)  <br /></span><span style="color: #008080; "> 7</span> <span style="color: #000000; ">   </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> String method1() {  <br /></span><span style="color: #008080; "> 8</span> <span style="color: #000000; ">     </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> “error”;  <br /></span><span style="color: #008080; "> 9</span> <span style="color: #000000; ">   }  <br /></span><span style="color: #008080; ">10</span> <span style="color: #000000; ">}</span></div><span style="color: #000000;"></span><span style="color: #000000;"></span></div></div><div>鎴戜滑璋冪敤method1鏂規(guī)硶鍙互閫氳繃涓ょ鏂瑰紡錛?br /> 1 <span style="color: #0000ff; font-size: medium;"> <span style="font-size: small;"><strong>/hello!method1.action</strong> </span> </span> <span style="font-size: small;"> 鏄犲皠</span> <span style="font-size: small;">url錛?strong><span style="color: #0000ff; font-size: small;">/WEB-INF/content/hello-error.jsp</span> </strong> </span> <span style="font-size: small;"><br /> 2</span> <span style="font-size: small;"> <span style="font-size: medium;"><strong><span style="color: #0000ff; font-size: small;">/another/url!method1.action</span> </strong> </span> </span> <span style="font-size: small;"> 鏄犲皠</span> <span style="font-size: small;">url錛?span style="font-size: small;"><strong><span style="color: #0000ff;">/WEB-INF/content/another/url-error.jsp</span> </strong> </span> </span> <br /> 鍙錛屼袱縐嶆柟寮忓潎鍙method1鏂規(guī)硶榪涜璋冪敤錛屽敮涓鐨勫尯鍒氨鏄紝涓ょ璋冪敤鐨勬槧灝勬槸涓嶄竴鏍風(fēng)殑錛屾墍浠ワ紝鎯寵煩杞埌涓嶅悓鐨勭晫闈紝榪欐槸涓涓潪甯稿ソ鐨勯夋嫨銆?/div><p> </p><p><strong>閫氳繃@Namespace 娉ㄩ噴</strong></p><div><div><span style="color: #000000;"></span><span style="color: #000000;"></span><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; "> 1</span> <span style="color: #0000FF; ">import</span><span style="color: #000000; "> com.opensymphony.xwork2.ActionSupport;<br /></span><span style="color: #008080; "> 2</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">import</span><span style="color: #000000; "> org.apache.struts2.convention.annotation.Action;<br /></span><span style="color: #008080; "> 3</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">import</span><span style="color: #000000; "> org.apache.struts2.convention.annotation.Actions;<br /></span><span style="color: #008080; "> 4</span> <span style="color: #000000; "><br /></span><span style="color: #008080; "> 5</span> <span style="color: #000000; ">@Namespace(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">/other</span><span style="color: #000000; ">"</span><span style="color: #000000; ">)<br /></span><span style="color: #008080; "> 6</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">class</span><span style="color: #000000; "> HelloWorld </span><span style="color: #0000FF; ">extends</span><span style="color: #000000; "> ActionSupport {<br /></span><span style="color: #008080; "> 7</span> <span style="color: #000000; "><br /></span><span style="color: #008080; "> 8</span> <span style="color: #000000; ">    </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> String method1() {  <br /></span><span style="color: #008080; "> 9</span> <span style="color: #000000; ">        </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> “error”;  <br /></span><span style="color: #008080; ">10</span> <span style="color: #000000; ">    }    <br /></span><span style="color: #008080; ">11</span> <span style="color: #000000; ">    @Action(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">url</span><span style="color: #000000; ">"</span><span style="color: #000000; ">)  <br /></span><span style="color: #008080; ">12</span> <span style="color: #000000; ">    </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> String method2() {  <br /></span><span style="color: #008080; ">13</span> <span style="color: #000000; ">        </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> “error”;  <br /></span><span style="color: #008080; ">14</span> <span style="color: #000000; ">    }    <br /></span><span style="color: #008080; ">15</span> <span style="color: #000000; ">    @Action(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">/different/url</span><span style="color: #000000; ">"</span><span style="color: #000000; ">)  <br /></span><span style="color: #008080; ">16</span> <span style="color: #000000; ">    </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> String method3() {  <br /></span><span style="color: #008080; ">17</span> <span style="color: #000000; ">         </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> “error”;  <br /></span><span style="color: #008080; ">18</span> <span style="color: #000000; ">    }    <br /></span><span style="color: #008080; ">19</span> <span style="color: #000000; ">}</span></div><span style="color: #000000;"> </span></div></div><div><span style="font-size: small;">閫氳繃 <strong><span style="color: #0000ff; font-size: small;">/other/hello-world!method1.action</span> </strong> </span> <span style="font-size: small;"> 璁塊棶<strong>method1</strong> 鏂規(guī)硶銆?br /> 閫氳繃</span> <strong> <span style="color: #0000ff; font-size: small;">/other/url!method2.action</span> </strong> <span style="font-size: small;"> 璁塊棶<strong>method2</strong> 鏂規(guī)硶<br /> 閫氳繃</span> <strong><span style="color: #0000ff; font-size: small;">/different /url!method3.action</span> </strong> <span style="font-size: small;"> 璁塊棶<strong>method3</strong> 鏂規(guī)硶</span> <br /> 涓嶡Action 娉ㄩ噴涓嶅悓鐨勬槸錛岃娉ㄩ噴瑕嗙洊浜嗛粯璁ょ殑namespace(榪欓噷鏄?#8217;/’)錛屾鏃跺啀鐢?span style="font-size: small;">hello!method1.action</span> 宸茬粡涓嶈兘璁塊棶<strong>method1</strong> 浜?<br /><strong>@Results鍜孈Result</strong> <br /><strong>1 鍏ㄥ眬鐨勶紙global錛夈?/strong> <br /> 鍏ㄥ眬results鍙互琚玜ction綾諱腑鎵鏈夌殑action鍒嗕韓錛岃繖縐峳esults鍦╝ction綾諱笂浣跨敤娉ㄨВ榪涜澹版槑銆?/div><div><div><span style="color: #000000;">   </span><span style="color: #000000;"><br /></span><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; "> 1</span> <span style="color: #0000FF; ">import</span><span style="color: #000000; "> com.opensymphony.xwork2.ActionSupport;   <br /></span><span style="color: #008080; "> 2</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">import</span><span style="color: #000000; "> org.apache.struts2.convention.annotation.Action;  <br /></span><span style="color: #008080; "> 3</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">import</span><span style="color: #000000; "> org.apache.struts2.convention.annotation.Actions;  <br /></span><span style="color: #008080; "> 4</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">import</span><span style="color: #000000; "> org.apache.struts2.convention.annotation.Result;  <br /></span><span style="color: #008080; "> 5</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">import</span><span style="color: #000000; "> org.apache.struts2.convention.annotation.Results;  <br /></span><span style="color: #008080; "> 6</span> <span style="color: #000000; ">     <br /></span><span style="color: #008080; "> 7</span> <span style="color: #000000; "> @Results({  <br /></span><span style="color: #008080; "> 8</span> <span style="color: #000000; ">   @Result(name</span><span style="color: #000000; ">=</span><span style="color: #000000; ">"</span><span style="color: #000000; ">failure</span><span style="color: #000000; ">"</span><span style="color: #000000; ">, location</span><span style="color: #000000; ">=</span><span style="color: #000000; ">"</span><span style="color: #000000; ">/WEB-INF/fail.jsp</span><span style="color: #000000; ">"</span><span style="color: #000000; ">)  <br /></span><span style="color: #008080; "> 9</span> <span style="color: #000000; "> })  <br /></span><span style="color: #008080; ">10</span> <span style="color: #000000; "> </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">class</span><span style="color: #000000; "> HelloWorld </span><span style="color: #0000FF; ">extends</span><span style="color: #000000; "> ActionSupport {  <br /></span><span style="color: #008080; ">11</span> <span style="color: #000000; ">   </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> String method1() {  <br /></span><span style="color: #008080; ">12</span> <span style="color: #000000; ">     </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> “failure”;  <br /></span><span style="color: #008080; ">13</span> <span style="color: #000000; ">   }  <br /></span><span style="color: #008080; ">14</span> <span style="color: #000000; ">     @Action(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">/different/url</span><span style="color: #000000; ">"</span><span style="color: #000000; ">)  <br /></span><span style="color: #008080; ">15</span> <span style="color: #000000; ">   </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> String method2() {  <br /></span><span style="color: #008080; ">16</span> <span style="color: #000000; ">     </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> “failure”;  <br /></span><span style="color: #008080; ">17</span> <span style="color: #000000; ">   }  <br /></span><span style="color: #008080; ">18</span> <span style="color: #000000; ">}</span></div></div></div><div><span style="font-size: small;">褰撴垜浠闂?/span> <span style="font-size: small;"> <strong> </strong> </span> <span style="font-size: small;"><strong><span style="color: #0000ff; font-size: small;">/hello</span> </strong> </span> <span style="font-size: small;"><strong><span style="color: #0000ff; font-size: small;">-world</span> </strong> </span> <span style="font-size: small;"><strong><span style="color: #0000ff; font-size: small;">!method1.action</span> </strong> <span style="font-size: small;">鏃訛紝榪斿洖</span> <span style="color: #0000ff; font-size: small;"> <strong>/WEB-INF/fail.jsp</strong> </span> <br /><span style="font-size: small;">褰撴垜浠闂?/span> <strong><span style="color: #0000ff; font-size: small;">/hello</span> </strong> </span> <span style="font-size: small;"><strong><span style="color: #0000ff; font-size: small;">-world</span> </strong> </span> <span style="font-size: small;"><strong><span style="color: #0000ff; font-size: small;">!method2.action</span> </strong> <span style="font-size: small;">鏃訛紝榪斿洖</span> <strong><span style="color: #0000ff; font-size: small;">/WEB-INF/fail.jsp</span> </strong> <br /><span style="font-size: small;">褰撴垜浠闂?/span> <strong><span style="color: #0000ff; font-size: small;"> /different/url!method2.action</span> </strong> <span style="font-size: small;">鏃訛紝榪斿洖</span> <strong> <span style="color: #0000ff; font-size: small;">/WEB-INF/fail.jsp</span> </strong> </span> <br /><br /><strong>2 鏈湴鐨勶紙local錛夈?/strong> <br /> 鏈湴results鍙兘鍦╝ction鏂規(guī)硶涓婅繘琛屽0鏄庛?/div><div><div style="background-color: #eeeeee; font-size: 13px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%;"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; "> 1</span> <span style="color: #000000; ">   <br /></span><span style="color: #008080; "> 2</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">import</span><span style="color: #000000; "> com.opensymphony.xwork2.ActionSupport;   <br /></span><span style="color: #008080; "> 3</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">import</span><span style="color: #000000; "> org.apache.struts2.convention.annotation.Action;<br /></span><span style="color: #008080; "> 4</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">import</span><span style="color: #000000; "> org.apache.struts2.convention.annotation.Actions;  <br /></span><span style="color: #008080; "> 5</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">import</span><span style="color: #000000; "> org.apache.struts2.convention.annotation.Result;  <br /></span><span style="color: #008080; "> 6</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">import</span><span style="color: #000000; "> org.apache.struts2.convention.annotation.Results;  <br /></span><span style="color: #008080; "> 7</span> <span style="color: #000000; ">  <br /></span><span style="color: #008080; "> 8</span> <span style="color: #000000; "></span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">class</span><span style="color: #000000; "> HelloWorld </span><span style="color: #0000FF; ">extends</span><span style="color: #000000; "> ActionSupport {  <br /></span><span style="color: #008080; "> 9</span> <span style="color: #000000; ">   @Action(value</span><span style="color: #000000; ">=</span><span style="color: #000000; ">"</span><span style="color: #000000; ">/other/bar</span><span style="color: #000000; ">"</span><span style="color: #000000; ">,results</span><span style="color: #000000; ">=</span><span style="color: #000000; ">{@Result(name </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #000000; ">"</span><span style="color: #000000; ">error</span><span style="color: #000000; ">"</span><span style="color: #000000; ">, location </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #000000; ">"</span><span style="color: #000000; ">www.baidu.com</span><span style="color: #000000; ">"</span><span style="color: #000000; ">,type</span><span style="color: #000000; ">=</span><span style="color: #000000; ">"</span><span style="color: #000000; ">redirect</span><span style="color: #000000; ">"</span><span style="color: #000000; ">)})  <br /></span><span style="color: #008080; ">10</span> <span style="color: #000000; ">   </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> String method1() {  <br /></span><span style="color: #008080; ">11</span> <span style="color: #000000; ">     </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> “error”;  <br /></span><span style="color: #008080; ">12</span> <span style="color: #000000; ">   }  <br /></span><span style="color: #008080; ">13</span> <span style="color: #000000;">} <br /></span></div><span style="color: #000000;"> </span> </div><div><span style="font-size: small;">褰撴垜浠皟鐢?/span> <span style="font-size: small;"><strong><span style="color: #0000ff;">/hello</span> </strong> </span> <span style="font-size: small;"><strong><span style="color: #0000ff; font-size: small;">-world</span> </strong> </span> <span style="font-size: small;"><strong><span style="color: #0000ff;">!method1.action</span> </strong> </span> <span style="font-size: small;"> 鏃訛紝榪斿洖</span> <strong> <span style="color: #0000ff; font-size: small;">/WEB-INF/content/hello-error.jsp</span> </strong> <span style="font-size: small;"><br /></span> <span style="font-size: small;">褰撴垜浠皟鐢?/span> <strong> <span style="color: #0000ff; font-size: small;">/other/bar!method1.action</span> </strong> <span style="font-size: small;"> 鏃訛紝榪斿洖</span> <span style="font-size: small;"><strong> <span style="color: #0000ff;">www.baidu.com</span> </strong> </span> </div></div><img src ="http://www.tkk7.com/hhhaaawwwkkk/aggbug/365679.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/hhhaaawwwkkk/" target="_blank">鐢熷懡鐨勭喚鏀?/a> 2011-12-10 12:52 <a href="http://www.tkk7.com/hhhaaawwwkkk/archive/2011/12/10/365679.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>struts2瀛︿範(fàn)絎旇錛堜笁錛?-action鎺ュ彈鍙傛暟http://www.tkk7.com/hhhaaawwwkkk/archive/2011/12/10/365625.html鐢熷懡鐨勭喚鏀?/dc:creator>鐢熷懡鐨勭喚鏀?/author>Sat, 10 Dec 2011 04:52:00 GMThttp://www.tkk7.com/hhhaaawwwkkk/archive/2011/12/10/365625.htmlhttp://www.tkk7.com/hhhaaawwwkkk/comments/365625.htmlhttp://www.tkk7.com/hhhaaawwwkkk/archive/2011/12/10/365625.html#Feedback0http://www.tkk7.com/hhhaaawwwkkk/comments/commentRss/365625.htmlhttp://www.tkk7.com/hhhaaawwwkkk/services/trackbacks/365625.htmlaction
 1 public class UserAction extends ActionSupport {
 2     
 3     private String name;
 4     private int age;
 5     
 6     public String add() {
 7         System.out.println("name=" + name);
 8         System.out.println("age=" + age);
 9         return SUCCESS;
10     }
11 
12     public String getName() {
13         return name;
14     }
15 
16     public void setName(String name) {
17         this.name = name;
18     }
19 
20     public int getAge() {
21         return age;
22     }
23 
24     public void setAge(int age) {
25         this.age = age;
26     }
27     
28     
29 }
欏甸潰浼犻掑弬鏁頒負(fù)name涓巃ge濡傦細(xì)<a href="user/user!add?name=a&age=8">娣誨姞鐢ㄦ埛</a>

浜屻佷嬌鐢―omainModel鎺ュ彈鍙傛暟
action
 1 public class UserAction extends ActionSupport {
 2     
 3     private User user;
 4     //private UserDTO userDTO;
 5     public String add() {
 6         System.out.println("name=" + user.getName());
 7         System.out.println("age=" + user.getAge());
 8         return SUCCESS;
 9     }
10 
11     public User getUser() {
12         return user;
13     }
14 
15     public void setUser(User user) {
16         this.user = user;
17     }
18 }
domain
 1 public class User {
 2     private String name;
 3     private int age;
 4     public String getName() {
 5         return name;
 6     }
 7     public void setName(String name) {
 8         this.name = name;
 9     }
10     public int getAge() {
11         return age;
12     }
13     public void setAge(int age) {
14         this.age = age;
15     }
16 }
欏甸潰浼犻掑弬鏁版槸闇瑕佽繖鏍鋒潵浼犻掑錛?br />
<a href="user/user!add?user.name=a&user.age=8">娣誨姞鐢ㄦ埛</a>


]]>
struts2瀛︿範(fàn)絎旇錛堜竴錛?-struts.xml閰嶇疆鏂囦歡http://www.tkk7.com/hhhaaawwwkkk/archive/2011/12/10/365624.html鐢熷懡鐨勭喚鏀?/dc:creator>鐢熷懡鐨勭喚鏀?/author>Sat, 10 Dec 2011 03:20:00 GMThttp://www.tkk7.com/hhhaaawwwkkk/archive/2011/12/10/365624.htmlhttp://www.tkk7.com/hhhaaawwwkkk/comments/365624.htmlhttp://www.tkk7.com/hhhaaawwwkkk/archive/2011/12/10/365624.html#Feedback0http://www.tkk7.com/hhhaaawwwkkk/comments/commentRss/365624.htmlhttp://www.tkk7.com/hhhaaawwwkkk/services/trackbacks/365624.html瀛︿範(fàn)sturts2鏃犻潪灝辨槸瀛︿範(fàn)鍚勭閰嶇疆鑰屽凡銆傛渶閲嶈鐨勫氨鏄痵truts.xml閰嶇疆鏂囦歡銆?br />
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd"
>

<struts>
    
<include file="login.xml" /><!--灝嗗叾浠栫殑xml鏂囦歡瀹圭撼榪涙潵-->

    
<constant name="struts.devMode" value="true" />
    
<!-- 寮鍙戞ā寮忥紝鏇存敼閰嶇疆鏂囦歡鏃犻渶閲嶅惎鏈嶅姟鍣ㄣ?nbsp;-->

    
<constant name="struts.i18n.encoding" value="UTF-8" />
    
<!-- 瀛楃闆嗭紝欏甸潰浼犻掓槸涓枃闇瑕佷嬌鐢ㄦ閰嶇疆銆傝В鍐充腑鏂囬棶棰樸?nbsp;-->

    
<constant name="struts.custom.i18n.resources" value="i18n" />
    
<!-- 鍥介檯鍖?nbsp;-->

    
<constant name="struts.i18n.reload" value="false" />
    
<!--鍥介檯鍖栨槸鍚︾敓鏁?/span>-->

    
<constant name="struts.convention.classes.reload" value="false" />
    
<!-- 閰嶇疆Convention鎻掍歡鑷姩閲嶅姞杞芥槧灝?/span>-->

    
<constant name="struts.convention.action.packages" value="net.shopxx.action" />
    
<!--
        榪欎釜灞炴х敤浜庣害瀹欰ction 綾葷殑鏍瑰寘錛堣繖涓寘鏄疛ava 綾葷殑鍖咃紝鑰屼笉鏄疭truts.xml涓厤緗殑<package>鑺傜偣錛?br />        鍦ㄤ竴涓」鐩腑鏈夎繖鏍蜂竴緋誨垪鐨凧ava 鍖咃紝閭d箞褰撴寚瀹歝onvention鐨勮繖涓睘鎬э紝Struts
        妗嗘灦灝變細(xì)鍦ㄤ綘璁塊棶鐗瑰畾鐨刄RL鏃朵細(xì)鑷姩鐨勬壘鍒版墍瑕佺殑璇鋒眰鐨勫疄鐜扮被銆?nbsp;褰撲綘鍦ㄦ祻瑙堝櫒涓緭鍏ワ細(xì)
        http://localhost:8080/HelloWorld.action
        錛孲truts浼?xì)鑷姩鐨勬墤謭膀q舵墽琛宑om.ZTest.web.action.HelloWorldAction.java綾匯?br />        褰撲綘鍦ㄦ祻瑙堝櫒涓緭鍏ワ細(xì) http://localhost:8080/test/aaa.action
        錛孲truts浼?xì)鑷姩鐨勬墤謭膀q舵墽琛宑om.ZTest.web.action.test.aaaAction.java綾匯?br />    
-->

    
<constant name="struts.serve.static.browserCache" value="false" />
    
<!--鏄惁struts榪囨護(hù)鍣ㄤ腑鎻愪緵鐨勯潤鎬佸唴瀹瑰簲璇ヨ嫻忚鍣ㄧ紦瀛樺湪澶撮儴灞炴т腑-->

    
<constant name="struts.objectFactory" value="spring" />
    
<!-- com.opensymphony.xwork2.ObjectFactory鎺ュ彛 -->

    
<constant name="struts.multipart.maxSize" value="-1" />
    
<!-- multipart璇鋒眰淇℃伅鐨勬渶澶у昂瀵革紙鏂囦歡涓婁紶鐢級 -->

    
<constant name="struts.ui.theme" value="simple" />
    
<!-- 榛樿鐨刄I template涓婚 -->

    
<constant name="struts.action.extension" value="action" />
    
<!--
        鐢║RL鎵╁睍鍚嶆潵紜畾鏄惁榪欎釜璇鋒眰鏄鐢ㄤ綔Struts action錛屽叾瀹炰篃灝辨槸璁劇疆 action鐨勫悗緙錛屼緥濡俵ogin.do鐨?do'瀛?br />    
-->

    
<constant name="struts.convention.result.path" value="/WEB-INF/template/" />
    
<!--
        璁劇疆Convention鎻掍歡瀹氫綅瑙嗗浘璧勬簮鐨勬牴璺緞銆傞粯璁ゅ間負(fù)/WEB-INF/content
        榪欎釜灞炴х敤浜庣害瀹欰ction綾繪墽琛屽畬姣曚互鍚庤繑鍥炶祫婧愮殑緇撴灉璺緞 褰撲綘鍦ㄦ祻瑙堝櫒涓緭鍏ワ細(xì)xxx/HelloWorld.aciton
        錛孲truts浼?xì)鑷姩鐨勬墤謭膀q舵墽琛宑om.ZTest.web.action.HelloWorldAction.java綾伙紝騫舵斁鍥炲埌WEB-INF/template/HelloWorld.jsp銆?br />    
-->

    
<constant name="struts.convention.action.name.separator"
        value
="_" />
    
<!--
        榪欎釜灞炴ф槸綰﹀畾褰撲竴涓狫ava 綾?nbsp;鏈夊涓崟璇嶇粍鍚堟垚鐨勬椂鍊欙紝鏄犲皠鐨刄RL鍦板潃鐨勬椂鍊欒闂殑鏍煎紡鐨勫垎闅旂銆?br />        濡傛灉涓嶆寚瀹氳繖涓睘鎬э紝Struts榛樿鐨勫垎闅旂鏄?nbsp;“-”錛屼緥濡?nbsp;HelloWorldAction 鍒欒闂殑URL
        鏄疕ello-World.action 濡傛灉鎸囧畾榪欎釜灞炴ф槸涓婇潰鐨勬牸寮忥紝鍒欐槸娌℃湁鍒嗛殧絎︼紝浼?xì)鎸夌収Java 綾誨悕鐩存帴鏄犲皠錛屼緥濡?br />        HelloWorldAction 鍒欒闂殑URL 鏄疕elloWorld.action
    
-->

    
<constant name="struts.convention.action.name.lowercase"
        value
="false" />
    
<!--
        鏄惁灝咥ction綾昏漿鎹㈡垚灝忓啓褰撲竴涓被鐨勭被鍚嶆槸澶氫釜鍗曡瘝緇勫悎璧鋒潵鐨勬椂鍊欙紝渚嬪 HelloWolrdAction錛屽鏋滄寚瀹氫簡榪欎釜灞炴э紝
        鍒欒闂殑鍦板潃蹇呴』鏄細(xì) HelloWorld.action ,濡傛灉涓嶆槸鎸囧畾榪欎釜灞炴у垯鏄細(xì) helloworld.action
    
-->

    
<constant name="struts.convention.default.parent.package"
        value
="default" />
    
<!--
          榪欎釜灞炴ф寚瀹氱殑鏄疭trtus.xml涓厤緗殑 <package>鑺傜偣鐨勭埗鑺傜偣銆?br />      
-->

    
<constant name="struts.freemarker.manager.classname" value="net.shopxx.common.FreemarkerManager" />
    
<!--
        灞炴ф寚瀹歋truts 2浣跨敤鐨凢reeMarker綆$悊鍣ㄣ傝灞炴х殑榛樿鍊兼槸
        org.apache.struts2.views.freemarker.FreemarkerManager錛岃繖鏄疭truts
        2鍐呭緩鐨凢reeMarker綆$悊鍣ㄣ?br />        struts.freemarker.wrapper.altMap璇ュ睘鎬у彧鏀寔true鍜宖alse涓や釜灞炴у鹼紝榛樿鍊兼槸true銆傞氬父鏃犻渶淇敼璇ュ睘鎬у箋?br />    
-->

    
<!--璁塊棶http://localhost:8080/宸ョ▼鍚?hello_struts錛堟棦鍙互璁塊棶鏍圭洰褰曚笅寰桯ello.jsp錛?/span>-->
    
<package name="front" extends="struts-default" namespace="/">
        
<default-action-ref name="errorPage404Action" /><!-- 榛樿鐨刟ction -->
        
<action name="errorPage404Action">
            
<result type="redirect">/html/error_page_404.html</result>
        
</action>
        
        
<global-results><!-- 鍏ㄥ眬鐨剅esult錛屽彧浣跨敤涓庢packeage涓殑鎵鏈塧ction -->
            
<result name="mainpage">/main.jsp</result>
        
</global-results>
        
        
<action name="index" class="com.bjsxt.struts2.front.action.IndexAction1">
            
<!--
                閰嶇疆浜哻lass紼嬪簭浼?xì)璁块棶鑷忿q殑action涓殑execute鏂規(guī)硶榪斿洖String錛屽return success
            
-->
            
<result name="success">/ActionIntroduction.jsp</result>
        
</action>
    
</package>

    
<package name="user" extends="struts-default" namespace="/user">
        
<action name="userAdd" class="com.bjsxt.struts2.user.action.UserAction"
            method
="add"><!--鍔犲叆浜唌ethod="add"鎵浠ヤ細(xì)璁塊棶UserAction涓殑add鏂規(guī)硶錛堣繖縐嶆柟娉曚笉寤鴻浣跨敤,蹇樹簡鍚э紒錛?/span>-->
            
<result>/user_add_success.jsp</result>
            
<!--
                欏甸潰璋冪敤<a href="<%=context
                %>/user/userAdd">娣誨姞鐢ㄦ埛</a>銆愯繖鏍蜂細(xì)璁塊棶銆憂amespace="/user"錛宎ction鍚嶇О涓簄ame="userAdd"鐨刟ction涓璦dd鏂規(guī)硶
            
-->
        
</action>
        
<action name="user" class="com.bjsxt.struts2.user.action.UserAction">
            
<!--
                寤鴻浣跨敤鐨勬柟娉曞湪榪欓噷錛岃繖鏍烽厤緗渶瑕佷嬌鐢ㄧ殑璋冪敤鍙戞斁鏄紙鍔ㄦ佽皟鐢―MI錛?br />            
-->
            
<result>/user_add_success.jsp</result>
            
<!--
                欏甸潰璋冪敤<a href="<%=context
                %>/user/user!add">娣誨姞鐢ㄦ埛</a>銆愯繖鏍蜂細(xì)璁塊棶銆憂amespace="/user"錛宎ction鍚嶇О涓簄ame="user"鐨刟ction涓璦dd鏂規(guī)硶
            
-->
            
<!--鐢ㄤ簬涓涓猘ction涓涓柟娉曞搴旇繑鍥炲悓涓涓〉闈紝榪斿洖涓嶅悓欏甸潰闇瑕侀厤緗涓猺esult-->
        
</action>
    
</package>

    
<package name="actions" extends="struts-default" namespace="/actions">
        
<action name="Student*" class="com.bjsxt.struts2.action.StudentAction"
            method
="{1}">
            
<result>/Student{1}_success.jsp</result>
            
<!--
                閫氶厤絎︾殑浣跨敤錛沯sp涓湁涓や釜璁塊棶榪炴帴 <a href="<%=context
                %>/actions/Studentadd">娣誨姞瀛︾敓</a> <a href="<%=context
                %>/actions/Studentdelete">鍒犻櫎瀛︾敓</a>
                *鍜寋1}灝辨槸濉厖add鍜宒elete鍚庢墍璁塊棶a(chǎn)ction涓殑鏂規(guī)硶涓巎sp 銆恆ction涓竴瀹氫細(xì)鏈変袱涓柟娉曚竴涓猘dd涓涓猟elete銆?br />            
-->
            
<!--鐢ㄤ簬涓涓猘ction涓涓柟娉曪紝榪斿洖涓嶅悓欏甸潰銆傚彧闇閰嶇疆涓涓甫鏈夐氶厤絎︾殑result銆愮害瀹氫紭浜庨厤緗?/span>-->
        
</action>
        
<action name="*_*" class="com.bjsxt.struts2.action.{1}Action"
            method
="{2}"><!--絎竴涓?瀵瑰簲{1}錛涚浜屼釜*瀵瑰簲{2}-->
            
<result>/{1}_{2}_success.jsp</result>
            
<!-- {0}_success.jsp -->
        
</action>
        
<!--鐢ㄤ簬澶氫釜action涓涓柟娉曪紝榪斿洖涓嶅悓欏甸潰銆傚彧闇閰嶇疆涓涓甫鏈夐氶厤絎︾殑result銆愮害瀹氫紭浜庨厤緗?/span>-->
    
</package>

    
<package name="default" namespace="/" extends="struts-default">
        
<default-action-ref name="index"></default-action-ref>
        
<!--榛樿鐨刟ction閰嶇疆-->
        
<action name="index">
            
<result>/default.jsp</result>
        
</action>
    
</package>

</struts>
濡傛灉浣跨敤struts2鐨刢onvertion plugin綰︽潫錛屽彲浠ュ畬鍏ㄤ笉鐢ㄩ厤緗產(chǎn)ction


]]>
struts2瀛︿範(fàn)絎旇錛堝洓錛?-鑾峰彇Session鍜宺equest鏂規(guī)硶http://www.tkk7.com/hhhaaawwwkkk/archive/2009/09/09/294505.html鐢熷懡鐨勭喚鏀?/dc:creator>鐢熷懡鐨勭喚鏀?/author>Wed, 09 Sep 2009 12:14:00 GMThttp://www.tkk7.com/hhhaaawwwkkk/archive/2009/09/09/294505.htmlhttp://www.tkk7.com/hhhaaawwwkkk/comments/294505.htmlhttp://www.tkk7.com/hhhaaawwwkkk/archive/2009/09/09/294505.html#Feedback1http://www.tkk7.com/hhhaaawwwkkk/comments/commentRss/294505.htmlhttp://www.tkk7.com/hhhaaawwwkkk/services/trackbacks/294505.html//絎竴縐嶅緢灝戠敤public class LoginAction1 extends ActionSupport { &n...  闃呰鍏ㄦ枃

]]>
鍏充簬struts2鏍囩鍙栧肩殑澶囧繕褰?杞?http://www.tkk7.com/hhhaaawwwkkk/archive/2009/09/08/294360.html鐢熷懡鐨勭喚鏀?/dc:creator>鐢熷懡鐨勭喚鏀?/author>Tue, 08 Sep 2009 14:41:00 GMThttp://www.tkk7.com/hhhaaawwwkkk/archive/2009/09/08/294360.htmlhttp://www.tkk7.com/hhhaaawwwkkk/comments/294360.htmlhttp://www.tkk7.com/hhhaaawwwkkk/archive/2009/09/08/294360.html#Feedback0http://www.tkk7.com/hhhaaawwwkkk/comments/commentRss/294360.htmlhttp://www.tkk7.com/hhhaaawwwkkk/services/trackbacks/294360.html鍙栧艱閫氳繃<s:property value="" />鎴栧湪浠繪剰鐨?lt;s:/>鏍囩鍐呬嬌鐢?{}錛?span class="Apple-converted-space"> 

褰揂ction鐨剉alueStack涓湁璇ュ睘鎬х殑鍊兼椂錛屽彧闇鐩存帴浣跨敤璇ュ睘鎬х殑鍚嶅瓧鍗沖彲錛?span class="Apple-converted-space"> 

褰揂ction鐨剉alueStack涓病鏈夎灞炴х殑鍊兼椂錛屾瘮濡傚湪session,application鑼冨洿涓殑灞炴у兼椂錛岄渶瑕佸姞#鎴栬?attr.錛?span class="Apple-converted-space"> 

渚嬪瓙錛?span class="Apple-converted-space"> 
鍋囪鏌怉ction涓湁person鎴愬憳鍙橀噺錛屽湪application涓瓨鍦╟ompany灞炴?span class="Apple-converted-space"> 
閭d箞鎴戜滑鍙互閫氳繃浠ヤ笅鏂規(guī)硶鍙栧鹼細(xì) 
<s:property value="person.name" /> 
<s:property value="#person.name" /> 
<s:property value="company.name" /> //鏃犳硶鍙栧埌錛屽洜涓篶ompany涓嶅湪action鐨剉alueStack涓?span class="Apple-converted-space"> 
<s:property value="#company.name" /> 

<s:textfield name="person.name" value="person.name" /> //閿欒錛寁alue浼?xì)鐩存帴鏄窘C簆erson.name瀛楁牱 
<s:textfield name="person.name" value="%{person.name}" /> 
<s:textfield name="person.company.name" value="%{#company.name}" /> 
<s:textfield name="person.company.name" value="%{#attr.company.name}" /> 

]]>
struts2.0鍏ラ棬涓庨厤緗?/title><link>http://www.tkk7.com/hhhaaawwwkkk/archive/2008/11/02/238187.html</link><dc:creator>鐢熷懡鐨勭喚鏀?/dc:creator><author>鐢熷懡鐨勭喚鏀?/author><pubDate>Sun, 02 Nov 2008 08:13:00 GMT</pubDate><guid>http://www.tkk7.com/hhhaaawwwkkk/archive/2008/11/02/238187.html</guid><wfw:comment>http://www.tkk7.com/hhhaaawwwkkk/comments/238187.html</wfw:comment><comments>http://www.tkk7.com/hhhaaawwwkkk/archive/2008/11/02/238187.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/hhhaaawwwkkk/comments/commentRss/238187.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/hhhaaawwwkkk/services/trackbacks/238187.html</trackback:ping><description><![CDATA[涓銆佸紑鍙戝噯澶囧伐浣滐細(xì)<br /> 1.棣栧厛涓嬭澆struts2.0鐨勫寘<a >http://struts.apache.org/download.cgi#struts2012</a>涓嬭澆Full Distribution銆?br />     lib鍖呭惈鎵鏈夌殑struts2.0鐨刯ar鍖咃紝浠ュ強(qiáng)瀹冩墍渚濊禆鐨勭涓夋柟鐨刯ar鍖咃紱<br />     apps鏄痵truts2.0鐨勪竴浜涗緥瀛愶紱<br />     docs鍖呭惈struts2鐨勬墍鏈夊府鍔╂枃妗o紱<br />     src鍖呭惈struts2鎵鏈夌殑婧愪唬鐮侊紱<br />     j4鏄府鍔﹋dk1.4鑳藉鏀寔struts2.濡傛灉鐢╦dk1.4浠ヤ笂鐨勭増鏈紙jdk5.0/jsd6.0錛夊垯涓嶉渶瑕侊紱<br /> 2.寮鍙戠幆澧冿細(xì)<br />     IDE錛歁yEclipse6.0錛汼ervlet Container錛歵omcat6.0錛?br /> 浜屻佸姩鎵嬪紑鍙戜竴涓畝鍗曠殑渚嬪瓙<br /> 1銆佹墦寮Eclipse 3.2鏂板緩Web宸ョ▼ <p>2銆佸姞鍏turts2鐨刯ar鍖?br />     commons-logging-1.0.4.jar-----鏃ュ織鍖咃紱<br />     freemarker-2.3.8.jar<br />     ognl-2.6.11.jar<br />     struts2-core-2.0.11.jar<br />     xwork-2.0.4.jar<br /> 3.淇敼web.xml鏂囦歡涓轟互涓嬩唬鐮侊細(xì) </p> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img src="http://www.tkk7.com/Images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #0000ff"><?</span><span style="color: #ff00ff">xml version="1.0" encoding="ISO-8859-1"</span><span style="color: #0000ff">?></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/Images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff"><!</span><span style="color: #ff00ff">DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/Images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff"><</span><span style="color: #800000">web-app</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/Images/OutliningIndicators/None.gif" align="top" alt="" />    </span><span style="color: #0000ff"><</span><span style="color: #800000">display-name</span><span style="color: #0000ff">></span><span style="color: #000000">Struts 2.0 Hello World</span><span style="color: #0000ff"></</span><span style="color: #800000">display-name</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/Images/OutliningIndicators/None.gif" align="top" alt="" />    </span><span style="color: #0000ff"><</span><span style="color: #800000">filter</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/Images/OutliningIndicators/None.gif" align="top" alt="" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">filter-name</span><span style="color: #0000ff">></span><span style="color: #000000">struts2</span><span style="color: #0000ff"></</span><span style="color: #800000">filter-name</span><span style="color: #0000ff">></span><span style="color: #000000">        </span><span style="color: #0000ff"><</span><span style="color: #800000">filter-class</span><span style="color: #0000ff">></span><span style="color: #000000">org.apache.struts2.dispatcher.FilterDispatcher</span><span style="color: #0000ff"></</span><span style="color: #800000">filter-class</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/Images/OutliningIndicators/None.gif" align="top" alt="" />    </span><span style="color: #0000ff"></</span><span style="color: #800000">filter</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/Images/OutliningIndicators/None.gif" align="top" alt="" />    </span><span style="color: #0000ff"><</span><span style="color: #800000">filter-mapping</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/Images/OutliningIndicators/None.gif" align="top" alt="" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">filter-name</span><span style="color: #0000ff">></span><span style="color: #000000">struts2</span><span style="color: #0000ff"></</span><span style="color: #800000">filter-name</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/Images/OutliningIndicators/None.gif" align="top" alt="" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">url-pattern</span><span style="color: #0000ff">></span><span style="color: #000000">/*</span><span style="color: #0000ff"></</span><span style="color: #800000">url-pattern</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/Images/OutliningIndicators/None.gif" align="top" alt="" />    </span><span style="color: #0000ff"></</span><span style="color: #800000">filter-mapping</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/Images/OutliningIndicators/None.gif" align="top" alt="" />    </span><span style="color: #0000ff"><</span><span style="color: #800000">welcome-file-list</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/Images/OutliningIndicators/None.gif" align="top" alt="" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">welcome-file</span><span style="color: #0000ff">></span><span style="color: #000000">index.html</span><span style="color: #0000ff"></</span><span style="color: #800000">welcome-file</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/Images/OutliningIndicators/None.gif" align="top" alt="" />    </span><span style="color: #0000ff"></</span><span style="color: #800000">welcome-file-list</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/Images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff"></</span><span style="color: #800000">web-app</span><span style="color: #0000ff">></span></div> 4.鍦╓ebRoot涓嬫柊寤哄悕涓簂ogin.jsp浠g爜濡備笅錛?br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img id="Codehighlighter1_2_44_Open_Image" onclick="this.style.display='none'; Codehighlighter1_2_44_Open_Text.style.display='none'; Codehighlighter1_2_44_Closed_Image.style.display='inline'; Codehighlighter1_2_44_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_2_44_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_2_44_Closed_Text.style.display='none'; Codehighlighter1_2_44_Open_Image.style.display='inline'; Codehighlighter1_2_44_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /><span style="color: #000000; background-color: #ffff00"><%</span><span id="Codehighlighter1_2_44_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span><span id="Codehighlighter1_2_44_Open_Text"><span style="color: #000000; background-color: #f5f5f5">@ page language</span><span style="color: #000000; background-color: #f5f5f5">=</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">java</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5"> pageEncoding</span><span style="color: #000000; background-color: #f5f5f5">=</span><span style="color: #000000; background-color: #f5f5f5">"</span><span style="color: #000000; background-color: #f5f5f5">UTF-8</span><span style="color: #000000; background-color: #f5f5f5">"</span></span><span style="color: #000000; background-color: #ffff00">%></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff"><!</span><span style="color: #ff00ff">DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff"><</span><span style="color: #800000">html</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />  </span><span style="color: #0000ff"><</span><span style="color: #800000">head</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />    </span><span style="color: #0000ff"><</span><span style="color: #800000">title</span><span style="color: #0000ff">></span><span style="color: #000000">My login.jsp</span><span style="color: #0000ff"></</span><span style="color: #800000">title</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />  </span><span style="color: #0000ff"></</span><span style="color: #800000">head</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />  </span><span style="color: #0000ff"><</span><span style="color: #800000">body</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />    </span><span style="color: #0000ff"><</span><span style="color: #800000">form </span><span style="color: #ff0000">action</span><span style="color: #0000ff">="login.action"</span><span style="color: #ff0000"> method</span><span style="color: #0000ff">="post"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />        username:</span><span style="color: #0000ff"><</span><span style="color: #800000">input </span><span style="color: #ff0000">type</span><span style="color: #0000ff">="text"</span><span style="color: #ff0000"> name</span><span style="color: #0000ff">="username"</span><span style="color: #0000ff">><</span><span style="color: #800000">br</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />        password:</span><span style="color: #0000ff"><</span><span style="color: #800000">input </span><span style="color: #ff0000">type</span><span style="color: #0000ff">="password"</span><span style="color: #ff0000"> name</span><span style="color: #0000ff">="password"</span><span style="color: #0000ff">><</span><span style="color: #800000">br</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">input </span><span style="color: #ff0000">type</span><span style="color: #0000ff">="submit"</span><span style="color: #ff0000"> value</span><span style="color: #0000ff">="submit"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />    </span><span style="color: #0000ff"></</span><span style="color: #800000">form</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />  </span><span style="color: #0000ff"></</span><span style="color: #800000">body</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff"></</span><span style="color: #800000">html</span><span style="color: #0000ff">></span></div> 5.鍦╯rc涓嬫柊寤轟竴涓寘錛屽悕涓篶om.test.action銆?br /> 6.鍦ㄥ寘涓柊寤轟竴涓猨ava綾伙紝鍚嶄負(fù)LoginAction.java錛屼唬鐮佸涓嬶細(xì)<br /> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #0000ff">package</span><span style="color: #000000"> com.test.action;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> com.opensymphony.xwork2.ActionSupport;<br /> <img id="Codehighlighter1_117_503_Open_Image" onclick="this.style.display='none'; Codehighlighter1_117_503_Open_Text.style.display='none'; Codehighlighter1_117_503_Closed_Image.style.display='inline'; Codehighlighter1_117_503_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_117_503_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_117_503_Closed_Text.style.display='none'; Codehighlighter1_117_503_Open_Image.style.display='inline'; Codehighlighter1_117_503_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> LoginAcion </span><span style="color: #0000ff">extends</span><span style="color: #000000"> ActionSupport </span><span id="Codehighlighter1_117_503_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">private</span><span style="color: #000000"> String username;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">private</span><span style="color: #000000"> String password;<br /> <img id="Codehighlighter1_200_222_Open_Image" onclick="this.style.display='none'; Codehighlighter1_200_222_Open_Text.style.display='none'; Codehighlighter1_200_222_Closed_Image.style.display='inline'; Codehighlighter1_200_222_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_200_222_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_200_222_Closed_Text.style.display='none'; Codehighlighter1_200_222_Open_Image.style.display='inline'; Codehighlighter1_200_222_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> String getUsername() </span><span id="Codehighlighter1_200_222_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> username;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img id="Codehighlighter1_266_297_Open_Image" onclick="this.style.display='none'; Codehighlighter1_266_297_Open_Text.style.display='none'; Codehighlighter1_266_297_Closed_Image.style.display='inline'; Codehighlighter1_266_297_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_266_297_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_266_297_Closed_Text.style.display='none'; Codehighlighter1_266_297_Open_Image.style.display='inline'; Codehighlighter1_266_297_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> setUsername(String username) </span><span id="Codehighlighter1_266_297_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">this</span><span style="color: #000000">.username </span><span style="color: #000000">=</span><span style="color: #000000"> username;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img id="Codehighlighter1_328_350_Open_Image" onclick="this.style.display='none'; Codehighlighter1_328_350_Open_Text.style.display='none'; Codehighlighter1_328_350_Closed_Image.style.display='inline'; Codehighlighter1_328_350_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_328_350_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_328_350_Closed_Text.style.display='none'; Codehighlighter1_328_350_Open_Image.style.display='inline'; Codehighlighter1_328_350_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> String getPassword() </span><span id="Codehighlighter1_328_350_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> password;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img id="Codehighlighter1_394_425_Open_Image" onclick="this.style.display='none'; Codehighlighter1_394_425_Open_Text.style.display='none'; Codehighlighter1_394_425_Closed_Image.style.display='inline'; Codehighlighter1_394_425_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_394_425_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_394_425_Closed_Text.style.display='none'; Codehighlighter1_394_425_Open_Image.style.display='inline'; Codehighlighter1_394_425_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> setPassword(String password) </span><span id="Codehighlighter1_394_425_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">this</span><span style="color: #000000">.password </span><span style="color: #000000">=</span><span style="color: #000000"> password;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />    @Override<br /> <img id="Codehighlighter1_480_501_Open_Image" onclick="this.style.display='none'; Codehighlighter1_480_501_Open_Text.style.display='none'; Codehighlighter1_480_501_Closed_Image.style.display='inline'; Codehighlighter1_480_501_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_480_501_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_480_501_Closed_Text.style.display='none'; Codehighlighter1_480_501_Open_Image.style.display='inline'; Codehighlighter1_480_501_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> String execute() </span><span style="color: #0000ff">throws</span><span style="color: #000000"> Exception </span><span id="Codehighlighter1_480_501_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> SUCCESS;<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <p>7.鍦╯rc鐩綍涓嬫柊寤轟竴涓悕涓簊truts.xml鐨勯厤緗枃浠朵唬鐮佸涓嬶細(xì)</p> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><span style="color: #0000ff"><?</span><span style="color: #ff00ff">xml version="1.0" encoding="UTF-8" </span><span style="color: #0000ff">?></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff"><!</span><span style="color: #ff00ff">DOCTYPE struts PUBLIC<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />    "http://struts.apache.org/dtds/struts-2.0.dtd"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff"><</span><span style="color: #800000">struts</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />    </span><span style="color: #0000ff"><</span><span style="color: #800000">package </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="struts"</span><span style="color: #ff0000"> extends</span><span style="color: #0000ff">="struts-default"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">action </span><span style="color: #ff0000">name</span><span style="color: #0000ff">="login"</span><span style="color: #ff0000"> class</span><span style="color: #0000ff">="com.test.action.LoginAction"</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />        </span><span style="color: #0000ff"><</span><span style="color: #800000">result</span><span style="color: #0000ff">></span><span style="color: #000000">/result.jsp</span><span style="color: #0000ff"></</span><span style="color: #800000">result</span><span style="color: #0000ff">></span><span style="color: #000000"> <br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />        </span><span style="color: #0000ff"></</span><span style="color: #800000">action</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" />    </span><span style="color: #0000ff"></</span><span style="color: #800000">package</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span><span style="color: #0000ff"></</span><span style="color: #800000">struts</span><span style="color: #0000ff">></span><span style="color: #000000"><br /> <img src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" alt="" /></span></div> <p>8.鏂板緩result.jsp</p> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><%@ page language="java" pageEncoding="UTF-8"%><br /> <%@ taglib prefix="s" uri="/struts-tags" %><br /> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><br /> <html><br />   <head><br />     <title>My login.jsp</title><br />   </head><br />   <body><br />      username:<s:property value="username"/><br><br />      password:<s:property value="password"/><br />   </body><br /> </html></div> 涓夈佽繍琛岀粨鏋滐細(xì)<br /> username:<input value="aaaaaaa" name="username" type="text" />                                           username:aaaaaaa<br /> password:<input type="password" name="password" />                                             password:aaaaaaa<br /> <input type="submit" value="submit" /> <br /> 鍥涖佹敞鎰忕殑鏂歸潰錛?br /> 1.struts.xml涓?lt;result>/result.jsp</result> 涔熷彲浠ュ啓鎴?lt;result name="success">/result.jsp</result> 瀹冧笌execute()鏂規(guī)硶涓殑return SUCCESS;鏄搴旂殑銆?br /> 2.login.jsp涓?lt;form action="login.action" method="post">錛屽鏋滀粖鍚庢垜浠敤鍒皊truts2鐨勬爣絳懼氨瑕佽繖鏍峰啓<s: form action="login" method="post">涓嶈鍦ㄥ姞涓?action銆?br /> <br />   <p><br />  </p> <img src ="http://www.tkk7.com/hhhaaawwwkkk/aggbug/238187.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/hhhaaawwwkkk/" target="_blank">鐢熷懡鐨勭喚鏀?/a> 2008-11-02 16:13 <a href="http://www.tkk7.com/hhhaaawwwkkk/archive/2008/11/02/238187.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Struts2.0鏍囩搴擄紙涓夛級琛ㄥ崟鏍囩http://www.tkk7.com/hhhaaawwwkkk/archive/2008/10/27/236925.html鐢熷懡鐨勭喚鏀?/dc:creator>鐢熷懡鐨勭喚鏀?/author>Mon, 27 Oct 2008 09:57:00 GMThttp://www.tkk7.com/hhhaaawwwkkk/archive/2008/10/27/236925.htmlhttp://www.tkk7.com/hhhaaawwwkkk/comments/236925.htmlhttp://www.tkk7.com/hhhaaawwwkkk/archive/2008/10/27/236925.html#Feedback1http://www.tkk7.com/hhhaaawwwkkk/comments/commentRss/236925.htmlhttp://www.tkk7.com/hhhaaawwwkkk/services/trackbacks/236925.html闃呰鍏ㄦ枃

]]>
Struts2.0鏍囩搴擄紙浜岋級鏁版嵁鏍囩[杞琞http://www.tkk7.com/hhhaaawwwkkk/archive/2008/10/24/236460.html鐢熷懡鐨勭喚鏀?/dc:creator>鐢熷懡鐨勭喚鏀?/author>Fri, 24 Oct 2008 10:25:00 GMThttp://www.tkk7.com/hhhaaawwwkkk/archive/2008/10/24/236460.htmlhttp://www.tkk7.com/hhhaaawwwkkk/comments/236460.htmlhttp://www.tkk7.com/hhhaaawwwkkk/archive/2008/10/24/236460.html#Feedback0http://www.tkk7.com/hhhaaawwwkkk/comments/commentRss/236460.htmlhttp://www.tkk7.com/hhhaaawwwkkk/services/trackbacks/236460.html闃呰鍏ㄦ枃

]]>
Struts2.0鏍囩搴擄紙涓錛夋帶鍒舵爣絳?/title><link>http://www.tkk7.com/hhhaaawwwkkk/archive/2008/10/24/struts2_append_ifelse_iterator_meger_subset.html</link><dc:creator>鐢熷懡鐨勭喚鏀?/dc:creator><author>鐢熷懡鐨勭喚鏀?/author><pubDate>Fri, 24 Oct 2008 06:56:00 GMT</pubDate><guid>http://www.tkk7.com/hhhaaawwwkkk/archive/2008/10/24/struts2_append_ifelse_iterator_meger_subset.html</guid><wfw:comment>http://www.tkk7.com/hhhaaawwwkkk/comments/236401.html</wfw:comment><comments>http://www.tkk7.com/hhhaaawwwkkk/archive/2008/10/24/struts2_append_ifelse_iterator_meger_subset.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.tkk7.com/hhhaaawwwkkk/comments/commentRss/236401.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/hhhaaawwwkkk/services/trackbacks/236401.html</trackback:ping><description><![CDATA[     鎽樿: Struts2.0鏍囩澶т綋鍙垎涓轟互涓嬪嚑綾伙細(xì) 1.UI錛圲ser Interface錛岀敤鎴風(fēng)晫闈級鏍囩錛氫富瑕佺敓鎴怘TML鍏冪礌鏍囩錛?    (1)琛ㄥ崟鏍囩錛氱敤浜庣敓鎴怘TML欏甸潰鐨刦orm鍏冪礌錛屼互鍙?qiáng)鏅氳〃鍗曞厓绱犵殑鏍囩銆?    (2)闈炶〃鍗曟爣絳撅細(xì)鐢ㄤ簬鐢熸垚欏甸潰涓婄殑鏍?wèi)銆乀ab涔熺瓑鏍囩銆?2.闈濽I鏍囩錛氫富瑕佺敤浜庢暟鎹闂?..  <a href='http://www.tkk7.com/hhhaaawwwkkk/archive/2008/10/24/struts2_append_ifelse_iterator_meger_subset.html'>闃呰鍏ㄦ枃</a><img src ="http://www.tkk7.com/hhhaaawwwkkk/aggbug/236401.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/hhhaaawwwkkk/" target="_blank">鐢熷懡鐨勭喚鏀?/a> 2008-10-24 14:56 <a href="http://www.tkk7.com/hhhaaawwwkkk/archive/2008/10/24/struts2_append_ifelse_iterator_meger_subset.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Struts2.0鐨凷truts.xml閰嶇疆鏂囦歡鏂囦歡緇撴瀯http://www.tkk7.com/hhhaaawwwkkk/archive/2008/10/22/235981.html鐢熷懡鐨勭喚鏀?/dc:creator>鐢熷懡鐨勭喚鏀?/author>Wed, 22 Oct 2008 08:52:00 GMThttp://www.tkk7.com/hhhaaawwwkkk/archive/2008/10/22/235981.htmlhttp://www.tkk7.com/hhhaaawwwkkk/comments/235981.htmlhttp://www.tkk7.com/hhhaaawwwkkk/archive/2008/10/22/235981.html#Feedback0http://www.tkk7.com/hhhaaawwwkkk/comments/commentRss/235981.htmlhttp://www.tkk7.com/hhhaaawwwkkk/services/trackbacks/235981.html
 1<?xml version="1.0" encoding="UTF-8"?>
 2
 3<!-- 涓嬮潰鎸囧畾Struts2閰嶇疆鏂囦歡鐨凞TD淇℃伅 -->
 4<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" 
 5"http://struts.apache.org/dtds/struts-2.0.dtd">
 6
 7<!-- struts鏄疭truts2閰嶇疆鏂囦歡鐨勮窡鍏冪礌 -->
 8<struts>
 9    <!--涓嬮潰鍏冪礌鍙互鍑虹幇0嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
10    <constant name="" value="" />
11    <!--涓嬮潰鍏冪礌鍙互鍑虹幇0嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
12    <bean class="" type="" name="" scope="" optional="" static="" />
13    <!--涓嬮潰鍏冪礌鍙互鍑虹幇0嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
14    <include file="" />
15    <!--package鍏冪礌鏄疭truts閰嶇疆鏂囦歡鐨勬牳蹇冿紝璇ュ厓绱犲彲浠ュ嚭鐜?嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
16    <package name="蹇呭~鐨勫寘鍚? extends="" namespace="" abstract=""
17        externalReferenceResolver="">
18        <!--璇ュ厓绱犲彲浠ュ嚭鐜幫紝涔熷彲浠ヤ笉鍑虹幇錛屾渶澶氬嚭鐜頒竴嬈?nbsp;-->
19        <result-types>
20            <!--璇ュ厓绱犲繀欏誨嚭鐜幫紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
21            <result-type name="" class="" default="false">
22                <!--涓嬮潰鍏冪礌鍙互鍑虹幇0嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
23                <param name="鍙傛暟鍚?>鍙傛暟鍊?/span></param>
24            </result-type>
25        </result-types>
26        <!--璇ュ厓绱犲彲浠ュ嚭鐜幫紝涔熷彲浠ヤ笉鍑虹幇錛屾渶澶氬嚭鐜頒竴嬈?nbsp;-->
27        <interceptors>
28            <!--璇ュ厓绱犵殑interceptor鍏冪礌鍜宨nterceptor-stack鑷沖皯鍑虹幇鍏朵腑涔嬩竴錛屼篃鍙簩鑰呴兘鍑虹幇 -->
29            <!--涓嬮潰鍏冪礌鍙互鍑虹幇0嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
30            <interceptor name="" class="">
31                <!--涓嬮潰鍏冪礌鍙互鍑虹幇0嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
32                <param name="鍙傛暟鍚?>鍙傛暟鍊?/span></param>
33            </interceptor>
34            <!--涓嬮潰鍏冪礌鍙互鍑虹幇0嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
35            <interceptor-stack name="">
36                <!--璇ュ厓绱犲繀欏誨嚭鐜幫紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
37                <interceptor-ref name="">
38                    <!--涓嬮潰鍏冪礌鍙互鍑虹幇0嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
39                    <param name="鍙傛暟鍚?>鍙傛暟鍊?/span></param>
40                </interceptor-ref>
41            </interceptor-stack>
42        </interceptors>
43        <!--涓嬮潰鍏冪礌鍙互鍑虹幇0嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
44        <default-interceptor-ref name="" />
45        <!--涓嬮潰鍏冪礌鍙互鍑虹幇0嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
46        <default-action-ref name="" />
47        <!--涓嬮潰鍏冪礌鍙互鍑虹幇0嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
48        <global-results>
49            <!--璇ュ厓绱犲繀欏誨嚭鐜幫紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
50            <result name="" type="">
51                <!--璇ュ瓧絎︿覆鍐呭鍙互鍑虹幇0嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
52                鏄犲皠璧勬簮
53                <!--涓嬮潰鍏冪礌鍙互鍑虹幇0嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
54                <param name="鍙傛暟鍚?>鍙傛暟鍊?/span></param>
55            </result>
56        </global-results>
57        <!--璇ュ瓧絎︿覆鍐呭鍙互鍑虹幇0嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
58        <global-exception-mappings>
59            <!--璇ュ厓绱犲繀欏誨嚭鐜幫紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
60            <exception-mapping result="" exception="" name="">
61                寮傚父澶勭悊璧勬簮
62                <!--璇ュ瓧絎︿覆鍐呭鍙互鍑虹幇0嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
63                <param name="鍙傛暟鍚?>鍙傛暟鍊?/span></param>
64            </exception-mapping>
65        </global-exception-mappings>
66        <!--璇ュ瓧絎︿覆鍐呭鍙互鍑虹幇0嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
67        <action name="" class="" converter="" method="">
68            <!--璇ュ瓧絎︿覆鍐呭鍙互鍑虹幇0嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
69            <param name="鍙傛暟鍚?>鍙傛暟鍊?/span></param>
70            <!--璇ュ瓧絎︿覆鍐呭鍙互鍑虹幇0嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
71            <result name="" type="">
72                鏄犲皠璧勬簮
73                <!--璇ュ瓧絎︿覆鍐呭鍙互鍑虹幇0嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
74                <param name="鍙傛暟鍚?>鍙傛暟鍊?/span></param>
75            </result>
76            <!--璇ュ瓧絎︿覆鍐呭鍙互鍑虹幇0嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
77            <interceptor-ref name="">
78                <!--璇ュ瓧絎︿覆鍐呭鍙互鍑虹幇0嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
79                <param name="鍙傛暟鍚?>鍙傛暟鍊?/span></param>
80            </interceptor-ref>
81            <!--璇ュ瓧絎︿覆鍐呭鍙互鍑虹幇0嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
82            <exception-mapping result="" exception="" name="">
83                寮傚父澶勭悊璧勬簮
84                <!--璇ュ瓧絎︿覆鍐呭鍙互鍑虹幇0嬈★紝涔熷彲浠ユ棤闄愬嬈?nbsp;-->
85                <param name="鍙傛暟鍚?>鍙傛暟鍊?/span></param>
86            </exception-mapping>
87        </action>
88    </package>
89</struts>
90


]]>
Struts2.0鐨凷truts.properties(杞?http://www.tkk7.com/hhhaaawwwkkk/archive/2008/10/21/235672.html鐢熷懡鐨勭喚鏀?/dc:creator>鐢熷懡鐨勭喚鏀?/author>Tue, 21 Oct 2008 06:36:00 GMThttp://www.tkk7.com/hhhaaawwwkkk/archive/2008/10/21/235672.htmlhttp://www.tkk7.com/hhhaaawwwkkk/comments/235672.htmlhttp://www.tkk7.com/hhhaaawwwkkk/archive/2008/10/21/235672.html#Feedback0http://www.tkk7.com/hhhaaawwwkkk/comments/commentRss/235672.htmlhttp://www.tkk7.com/hhhaaawwwkkk/services/trackbacks/235672.htmlstruts.action.extension
          The URL extension to use to determine if the request is meant for a Struts action
           鐢║RL鎵╁睍鍚嶆潵紜畾鏄惁榪欎釜璇鋒眰鏄鐢ㄤ綔Struts action錛屽叾瀹炰篃灝辨槸璁劇疆 action鐨勫悗緙錛屼緥濡俵ogin.do鐨刓'do\'瀛椼?/font>

struts.configuration
          The org.apache.struts2.config.Configuration implementation class
            org.apache.struts2.config.Configuration鎺ュ彛鍚?/font>

struts.configuration.files
          A list of configuration files automatically loaded by Struts
           struts鑷姩鍔犺澆鐨勪竴涓厤緗枃浠跺垪琛?/font>

struts.configuration.xml.reload
          Whether to reload the XML configuration or not
           鏄惁鍔犺澆xml閰嶇疆(true,false)

struts.continuations.package
           The package containing actions that use Rife continuations
           鍚湁actions鐨勫畬鏁磋繛緇殑package鍚嶇О

struts.custom.i18n.resources
          Location of additional localization properties files to load
           鍔犺澆闄勫姞鐨勫浗闄呭寲灞炴ф枃浠訛紙涓嶅寘鍚?properties鍚庣紑錛?/font>

struts.custom.properties
          Location of additional configuration properties files to load
           鍔犺澆闄勫姞鐨勯厤緗枃浠剁殑浣嶇疆


struts.devMode
          Whether Struts is in development mode or not
           鏄惁涓簊truts寮鍙戞ā寮?/font>

struts.dispatcher.parametersWorkaround
          Whether to use a Servlet request parameter workaround necessary for some versions of WebLogic
            錛堟煇浜涚増鏈殑weblogic涓撶敤錛夋槸鍚︿嬌鐢ㄤ竴涓猻ervlet璇鋒眰鍙傛暟宸ヤ綔鍖猴紙PARAMETERSWORKAROUND錛?/font>

struts.enable.DynamicMethodInvocation
          Allows one to disable dynamic method invocation from the URL
            鍏佽鍔ㄦ佹柟娉曡皟鐢?/font>

struts.freemarker.manager.classname
          The org.apache.struts2.views.freemarker.FreemarkerManager implementation class
           org.apache.struts2.views.freemarker.FreemarkerManager鎺ュ彛鍚?/font>

struts.i18n.encoding
          The encoding to use for localization messages
           鍥介檯鍖栦俊鎭唴鐮?/font>

struts.i18n.reload
          Whether the localization messages should automatically be reloaded
           鏄惁鍥介檯鍖栦俊鎭嚜鍔ㄥ姞杞?

struts.locale
          The default locale for the Struts application
           榛樿鐨勫浗闄呭寲鍦板尯淇℃伅

struts.mapper.class
          The org.apache.struts2.dispatcher.mapper.ActionMapper implementation class
            org.apache.struts2.dispatcher.mapper.ActionMapper鎺ュ彛

struts.multipart.maxSize
          The maximize size of a multipart request (file upload)
           multipart璇鋒眰淇℃伅鐨勬渶澶у昂瀵革紙鏂囦歡涓婁紶鐢級

struts.multipart.parser
          The org.apache.struts2.dispatcher.multipart.
          MultiPartRequest parser implementation for a multipart request (file upload)
          涓撲負(fù)multipart璇鋒眰淇℃伅浣跨敤鐨刼rg.apache.struts2.dispatcher.multipart.MultiPartRequest瑙f瀽鍣ㄦ帴鍙o紙鏂囦歡涓婁紶鐢級


struts.multipart.saveDir
          The directory to use for storing uploaded files
           璁劇疆瀛樺偍涓婁紶鏂囦歡鐨勭洰褰曞す

struts.objectFactory
          The com.opensymphony.xwork2.ObjectFactory implementation class
           com.opensymphony.xwork2.ObjectFactory鎺ュ彛錛坰pring錛?/font>

struts.objectFactory.spring.autoWire
          Whether Spring should autoWire or not
           鏄惁鑷姩緇戝畾Spring

struts.objectFactory.spring.useClassCache
          Whether Spring should use its class cache or not
           鏄惁spring搴旇浣跨敤鑷韓鐨刢ache

struts.objectTypeDeterminer
          The com.opensymphony.xwork2.util.ObjectTypeDeterminer implementation class
            com.opensymphony.xwork2.util.ObjectTypeDeterminer鎺ュ彛

struts.serve.static.browserCache
  If static content served by the Struts filter should set browser caching header properties or not
           鏄惁struts榪囨護(hù)鍣ㄤ腑鎻愪緵鐨勯潤鎬佸唴瀹瑰簲璇ヨ嫻忚鍣ㄧ紦瀛樺湪澶撮儴灞炴т腑

struts.serve.static
          Whether the Struts filter should serve static content or not
           鏄惁struts榪囨護(hù)鍣ㄥ簲璇ユ彁渚涢潤鎬佸唴瀹?/font>

struts.tag.altSyntax
          Whether to use the alterative syntax for the tags or not
           鏄惁鍙互鐢ㄦ浛浠g殑璇硶鏇夸唬tags

struts.ui.templateDir
          The directory containing UI templates
           UI templates鐨勭洰褰曞す

struts.ui.theme
          The default UI template theme
           榛樿鐨刄I template涓婚

struts.url.http.port
          The HTTP port used by Struts URLs
           璁劇疆http绔彛

struts.url.https.port
          The HTTPS port used by Struts URLs
           璁劇疆https绔彛

struts.url.includeParams
          The default includeParams method to generate Struts URLs
          鍦╱rl涓駭鐢?榛樿鐨刬ncludeParams

struts.velocity.configfile
          The Velocity configuration file path
           velocity閰嶇疆鏂囦歡璺緞

struts.velocity.contexts
          List of Velocity context names
           velocity鐨刢ontext鍒楄〃

struts.velocity.manager.classname
          org.apache.struts2.views.velocity.VelocityManager implementation class
           org.apache.struts2.views.velocity.VelocityManager鎺ュ彛鍚?/font>

struts.velocity.toolboxlocation
          The location of the Velocity toolbox
           velocity宸ュ叿鐩掔殑浣嶇疆

struts.xslt.nocache
          Whether or not XSLT templates should not be cached
           鏄惁XSLT妯$増搴旇琚紦瀛?/font>



]]>
主站蜘蛛池模板: 国产精品福利片免费看| 波多野结衣视频在线免费观看| 亚洲va中文字幕无码久久| 理论秋霞在线看免费| 免费网站看v片在线香蕉| 亚洲人成网站色在线观看| 亚洲综合免费视频| 久久久久亚洲Av无码专| 性xxxxx大片免费视频| 久久精品国产亚洲沈樵| 久久免费香蕉视频| 久久精品国产亚洲5555| 全部一级一级毛片免费看| 日本免费人成黄页在线观看视频| 亚洲国产日韩综合久久精品| 黄色片在线免费观看| 亚洲国产超清无码专区| 国产91免费视频| 亚洲国产精品一区二区久| 18禁男女爽爽爽午夜网站免费| 久久精品国产亚洲AV无码麻豆 | 亚洲国产老鸭窝一区二区三区| 中文字幕高清免费不卡视频| 亚洲一区二区三区无码影院| eeuss影院免费92242部| 亚洲精品456播放| 亚洲精品黄色视频在线观看免费资源 | 成全视成人免费观看在线看| 久久久久久久尹人综合网亚洲| 国色精品va在线观看免费视频| 精品国产_亚洲人成在线高清| 国产啪精品视频网站免费尤物 | 人禽杂交18禁网站免费| 一本色道久久综合亚洲精品蜜桃冫 | 在线综合亚洲中文精品| 成年女人喷潮毛片免费播放| 亚洲精品无码久久久久APP| 色吊丝最新永久免费观看网站| 国产亚洲一卡2卡3卡4卡新区| 四虎国产精品免费久久影院| 青青久久精品国产免费看|