⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch05s03.html

📁 优秀的java程序开发软件方式与方法,对大家开发程序的时候有指导性帮助
💻 HTML
📖 第 1 页 / 共 2 页
字号:
    &lt;submission name="increase"/&gt;    &lt;submission name="decrease"/&gt;  &lt;/element&gt;&lt;/site&gt;</pre><p>&#28982;&#21518;&#25105;&#20204;&#22312;counter.display&#27169;&#29256;&#20013;&#23450;&#20041;counter&#20540;&#20197;&#21450;&#20004;&#20010;&#38142;&#25509;&#24212;&#35813;&#26174;&#31034;&#22312;&#21738;&#37324;&#12290;</p><pre class="programlisting">&lt;!--I 'common.blueprint'/--&gt;&lt;!--I 'common.error_messages'/--&gt;&lt;!--BV 'window_title'--&gt;Counter Application&lt;!--/BV--&gt;&lt;!--BV 'content'--&gt;    &lt;div class="content"&gt;        &lt;h1&gt;Counter Application&lt;/h1&gt;        &lt;p&gt;&lt;!--V 'counter'/--&gt;&lt;/p&gt;        &lt;a href="[!V &#8216;SUBMISSION:QUERY:increase&#8217;/]"&gt;++&lt;/a&gt;        &lt;a href="[!V &#8216;SUBMISSION:QUERY:decrease&#8217;/]"&gt;--&lt;/a&gt;    &lt;/div&gt;&lt;!--/BV--&gt;</pre><p>&#19978;&#38754;&#23450;&#20041;&#20102;&#19968;&#20010;&#21483;counter&#30340;Value&#65292;&#35813;Value&#23558;&#30001;&#25105;&#20204;&#22312;CounterController&#31867;&#20013;&#25351;&#23450;&#12290;&#21478;&#22806;&#65292;&#25105;&#20204;&#30475;&#21040;&#21478;&#19968;&#31181;&#22768;&#26126;Value&#30340;&#26041;&#27861;&#65292;[!V/]&#65292;&#23427;&#30340;&#32467;&#26500;&#21644;&lt;!--V/--&gt;&#26159;&#19968;&#26679;&#30340;&#65292;&#20294;&#26159;&#23427;&#29992;&#22312;HTML&#24341;&#21495;&#20043;&#38388;&#12290;Value&#21517;SUBMISSION:QUERY:xxx&#26159;&#26377;&#24847;&#20041;&#30340;&#65292;&#23427;&#20250;&#29983;&#25104;&#19968;&#20010;&#25351;&#21521;&#35813;submission&#30340;URL&#12290;Increase&#21644;decrease&#20004;&#20010;submission&#21017;&#26159;&#25105;&#20204;&#21018;&#25165;&#22312;pub.xml&#37324;&#23450;&#20041;&#30340;&#12290;</p><p>&#22909;&#65292;&#29616;&#22312;&#20934;&#22791;&#24037;&#20316;&#37117;&#20570;&#22909;&#20102;&#65292;&#25105;&#20204;&#26469;&#30475;CounterController&#22914;&#20309;&#29992;continuation&#23454;&#29616;counter&#12290;&#20195;&#30721;&#22914;&#19979;&#65306;</p><pre class="programlisting">package counter;import com.uwyn.rife.engine.Element;import com.uwyn.rife.template.Template;public class CounterController extends Element {    private int count = 0;    private Template template;        public void initialize() {        template = getHtmlTemplate("counter.display");    }        public void processElement() {        while(true) {            template.setValue("counter", count);            print(template);            pause();                        if (hasSubmission("increase"))                count++;            if (hasSubmission("decrease"))                count--;        }    }}</pre><p>&#27880;&#24847;&#21040;&#25105;&#20204;&#22312;initialize()&#37324;&#35774;&#32622;&#27169;&#29256;&#65292;&#32780;&#19981;&#26159;&#30452;&#25509;private Template template = getHtmlTemplate(&#8220;counter.display&#8221;)&#12290;&#36825;&#24456;&#37325;&#35201;&#65292;&#22240;&#20026;initialize()&#20989;&#25968;&#20250;&#22312;&#19968;&#20010;&#37197;&#21046;&#22909;&#30340;&#29615;&#22659;&#20013;&#36816;&#34892;&#12290;&#19981;&#36807;&#25105;&#20204;&#19981;&#33021;&#25226;count = 0&#25918;&#22312;initialize()&#20013;&#65292;&#21542;&#21017;&#27599;&#27425;&#39029;&#38754;&#35843;&#29992;&#26102;count = 0&#37117;&#20250;&#25191;&#34892;&#12290;</p><p>&#22312;processElement()&#20989;&#25968;&#37324;&#25105;&#20204;&#29992;&#21040;&#19968;&#20010;&#27515;&#24490;&#29615;&#12290;&#22312;&#36825;&#37324;&#25105;&#20204;&#25226;&#27169;&#29256;&#20013;counter&#36825;&#20010;Value&#23450;&#25104;count&#30340;&#20540;&#65292;&#36755;&#20986;&#27169;&#29256;&#65292;&#28982;&#21518;&#25105;&#20204;pause()&#12290;&#36825;&#26102;&#25105;&#20204;&#30340;&#31243;&#24207;&#20250;&#26242;&#20572;&#65292;&#31561;&#24453;&#29992;&#25143;&#36755;&#20837;&#12290;&#29992;&#25143;&#36755;&#20837;&#23436;&#25104;&#21518;&#25105;&#20204;&#26816;&#26597;&#26159;&#21542;&#26377;submission&#65292;&#24182;&#36827;&#34892;&#30456;&#24212;&#30340;&#25805;&#20316;&#12290;&#20445;&#23384;&#25152;&#26377;&#25991;&#20214;&#65292;&#24182;&#27983;&#35272;<code class="uri">http://localhost:8080/</code>&#65292;&#25105;&#20204;&#20250;&#30475;&#21040;&#19979;&#38754;&#30340;&#39029;&#38754;&#12290;&#24744;&#21487;&#20197;&#35797;&#35797;&#21518;&#36864;&#38190;&#65292;&#33258;&#24049;&#39564;&#35777;&#19968;&#19979;Rife&#23545;&#21518;&#36864;&#30340;&#22788;&#29702;&#12290;</p><div class="screenshot"><div class="mediaobject"><img src="resources/rife-counter.png"></div></div><p>&#24744;&#24212;&#35813;&#27880;&#24847;&#21040;&#20102;&#65292;&#34429;&#28982;&#20004;&#32773;&#37117;&#20351;&#29992;continuation&#65292;&#20294;&#26159;Rife&#30340;&#20570;&#27861;&#21644;Seaside&#30340;&#30053;&#26377;&#19981;&#21516;&#12290;&#26368;&#20027;&#35201;&#30340;&#21306;&#21035;&#22312;&#20110;&#65292;Rife&#20013;&#30340;&#27169;&#29256;&#36755;&#20986;&#26159;&#25105;&#20204;&#25163;&#21160;&#35843;&#29992;&#30340;&#65292;&#32780;Seaside&#37324;renderContentOn&#26041;&#27861;&#26159;Seaside&#33258;&#21160;&#35843;&#29992;&#30340;&#12290;Rife&#29992;pause()&#30340;&#20570;&#27861;&#38750;&#24120;&#30452;&#35266;&#65292;&#20294;&#26159;&#20854;&#32570;&#38519;&#26159;&#26080;&#27861;&#25903;&#25345;Seaside&#30340;multi&#20363;&#23376;&#20013;&#25152;&#23637;&#31034;&#30340;&#8220;&#22810;&#27969;&#31243;&#25511;&#21046;&#8221;&#12290;&#22312;multi&#20013;&#26377;&#22810;&#20010;&#29420;&#31435;&#30340;&#27969;&#31243;&#65288;&#20363;&#23376;&#20013;&#26159;&#20960;&#20010;WACounter&#65289;&#22312;&#21516;&#26102;&#25191;&#34892;&#65292;&#27599;&#27425;&#35831;&#27714;&#26102;&#26377;&#19968;&#20010;&#27969;&#31243;&#20250;&#20570;&#20986;&#21453;&#24212;&#65292;&#20294;&#26159;&#20026;&#20102;&#29983;&#25104;&#25972;&#20010;&#39029;&#38754;&#65292;Seaside&#38656;&#35201;&#23545;&#27599;&#20010;WAComponent&#35843;&#29992;renderContentOn&#26041;&#27861;&#65292;&#32780;&#36825;&#22312;&#25163;&#21160;&#36755;&#20986;&#27169;&#29256;&#30340;Rife&#20013;&#26159;&#19981;&#21487;&#33021;&#30340;&#12290;</p><p>&#21478;&#22806;&#65292;Rife&#21463;&#21040;Java&#35821;&#35328;&#30340;&#38480;&#21046;&#65292;&#19981;&#21487;&#33021;&#29983;&#25104;&#30452;&#25509;&#35843;&#29992;&#20195;&#30721;&#30340;&#38142;&#25509;&#65292;&#32780;&#36825;&#31181;&#38142;&#25509;&#27491;&#26159;Seaside&#30340;&#21334;&#28857;&#20043;&#19968;&#12290;</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch05s02.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="ch05.html">Up</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="ch05s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">2.&nbsp;&#23433;&#35013;&#21644;&#21551;&#21160;Rife&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;4.&nbsp;&#29468;&#25968;&#23383;&#20043;Rife&#29256;</td></tr></table></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -