锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲精品无码国产片,亚洲AV日韩AV永久无码免下载,精品亚洲aⅴ在线观看http://www.tkk7.com/birdshover/鈥斺旇礬婕極鍏朵慨榪滃叜錛屽惥灝嗕笂涓嬭岀埇妤兼錛?/description>zh-cnSat, 10 May 2025 10:47:01 GMTSat, 10 May 2025 10:47:01 GMT60涓涓狫NI鐨勯棶棰樿鏁?/title><link>http://www.tkk7.com/birdshover/archive/2010/04/28/319625.html</link><dc:creator>Birdshover</dc:creator><author>Birdshover</author><pubDate>Wed, 28 Apr 2010 10:11:00 GMT</pubDate><guid>http://www.tkk7.com/birdshover/archive/2010/04/28/319625.html</guid><wfw:comment>http://www.tkk7.com/birdshover/comments/319625.html</wfw:comment><comments>http://www.tkk7.com/birdshover/archive/2010/04/28/319625.html#Feedback</comments><slash:comments>8</slash:comments><wfw:commentRss>http://www.tkk7.com/birdshover/comments/commentRss/319625.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/birdshover/services/trackbacks/319625.html</trackback:ping><description><![CDATA[<div><span style="color: #ff0000; ">榪欎釜闂姣旇緝鎬ワ紝鍊熺敤棣栭〉鍙戜竴涓嬶紝璋㈣阿錛?/span><br /> <br /> 鏈榪戦渶瑕佸涓涓狢++搴撹繘琛屽皝瑁咃紝涓虹畝鍗曡搗瑙佸喅瀹氫嬌鐢↗AVA瀵瑰叾灝佽銆備絾鏄竴鐩磋皟鐢ㄤ笉鎴愬姛錛屼簬鏄啓浜嗕竴孌墊祴璇曚唬鐮佹祴璇曚竴涓嬨備負綆鍗曡搗瑙侊紝灝變嬌鐢ㄩ粯璁ゅ寘浜嗐?/div> <br /> <div style="background-color: #eeeeee; font-size: 13px; border-left-color: #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; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">class</span><span style="color: #000000; "> TestDLL {<br />     </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">native</span><span style="color: #000000; "> String Test(String put);<br />     <br />     </span><span style="color: #0000FF; ">static</span><span style="color: #000000; ">{<br />         System.loadLibrary(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">testdll</span><span style="color: #000000; ">"</span><span style="color: #000000; ">);<br />     }<br />     <br />     </span><span style="color: #0000FF; ">public</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">static</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">void</span><span style="color: #000000; "> main(String[] args) {    <br />         TestDLL test </span><span style="color: #000000; ">=</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">new</span><span style="color: #000000; "> TestDLL();<br />         System.out.println(test.Test(</span><span style="color: #0000FF; ">new</span><span style="color: #000000; "> Date().toString()));<br />     }<br /> }</span></div> <br /> 鐒跺悗鐢熸垚浜咰++澶存枃浠?br /> <br /> <div style="background-color: #eeeeee; font-size: 13px; border-left-color: #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: #008000; ">/*</span><span style="color: #008000; "> DO NOT EDIT THIS FILE - it is machine generated </span><span style="color: #008000; ">*/</span><span style="color: #000000; "><br /> #include </span><span style="color: #000000; "><</span><span style="color: #000000; ">jni.h</span><span style="color: #000000; ">></span><span style="color: #000000; "><br /> </span><span style="color: #008000; ">/*</span><span style="color: #008000; "> Header for class TestDLL </span><span style="color: #008000; ">*/</span><span style="color: #000000; "><br /> <br /> #ifndef _Included_TestDLL<br /> </span><span style="color: #0000FF; ">#define</span><span style="color: #000000; "> _Included_TestDLL</span><span style="color: #000000; "><br /> #ifdef __cplusplus<br /> </span><span style="color: #0000FF; ">extern</span><span style="color: #000000; "> </span><span style="color: #000000; ">"</span><span style="color: #000000; ">C</span><span style="color: #000000; ">"</span><span style="color: #000000; "> {<br /> </span><span style="color: #0000FF; ">#endif</span><span style="color: #000000; "><br /> </span><span style="color: #008000; ">/*</span><span style="color: #008000; "><br />  * Class:     TestDLL<br />  * Method:    Test<br />  * Signature: (Ljava/lang/String;)Ljava/lang/String;<br />  </span><span style="color: #008000; ">*/</span><span style="color: #000000; "><br /> JNIEXPORT jstring JNICALL Java_TestDLL_Test<br />   (JNIEnv </span><span style="color: #000000; ">*</span><span style="color: #000000; ">, jobject, jstring);<br /> <br /> #ifdef __cplusplus<br /> }<br /> </span><span style="color: #0000FF; ">#endif</span><span style="color: #000000; "><br /> </span><span style="color: #0000FF; ">#endif</span></div> <br /> 涓嬮潰鏄畝鍗曠殑瀹炵幇<br /> <div style="background-color: #eeeeee; font-size: 13px; border-left-color: #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: #000000; ">#include </span><span style="color: #000000; ">"</span><span style="color: #000000; ">TestDLL.h</span><span style="color: #000000; ">"</span><span style="color: #000000; "><br /> <br /> JNIEXPORT jstring JNICALL Java_TestDLL_Test<br />   (JNIEnv </span><span style="color: #000000; ">*</span><span style="color: #000000; ">, jobject, jstring put){<br />       </span><span style="color: #0000FF; ">return</span><span style="color: #000000; "> put;<br /> }</span></div> <br /> <span style="color: red; ">鍦╨inux涓嬮氳繃gcc緙栬瘧鍚庯紝java璋冪敤錛?br /> java -Djava.library.path=/home/xp -cp . TestDLL<br /> <br /> 涓鐩存姤閿欙細</span><br /> <div style="background-color: #eeeeee; font-size: 13px; border-left-color: #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: #000000; ">Exception </span><span style="color: #0000FF; ">in</span><span style="color: #000000; "> thread </span><span style="color: #000000; ">"</span><span style="color: #000000; ">main</span><span style="color: #000000; ">"</span><span style="color: #000000; "> java.lang.UnsatisfiedLinkError: no testdll </span><span style="color: #0000FF; ">in</span><span style="color: #000000; "> java.library.path<br />         at java.lang.ClassLoader.loadLibrary(ClassLoader.java:</span><span style="color: #000000; ">1734</span><span style="color: #000000; ">)<br />         at java.lang.Runtime.loadLibrary0(Runtime.java:</span><span style="color: #000000; ">823</span><span style="color: #000000; ">)<br />         at java.lang.System.loadLibrary(System.java:</span><span style="color: #000000; ">1028</span><span style="color: #000000; ">)<br />         at TestDLL.main(TestDLL.java:</span><span style="color: #000000; ">27</span><span style="color: #000000; ">)</span></div> <br /> <span style="color: red; ">浣嗘槸鎴戝湪windows涓嬬紪璇戜簡testdll.dll鍚庯紝鑳藉璋冪敤姝e父銆?br /> </span><br /> <span style="color: red; ">鎺ョ潃鎴戞敼鍐欎負System.load("/home/xp/testdll.so");緇撴灉鍙互鍦╨inux浣跨敤浜嗭紝甯屾湜鏈夌粡楠岀殑鏈嬪弸鍙互瑙g瓟鎴戠殑鐤戦棶銆?br /> <br /> <br /> </span> <img src ="http://www.tkk7.com/birdshover/aggbug/319625.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/birdshover/" target="_blank">Birdshover</a> 2010-04-28 18:11 <a href="http://www.tkk7.com/birdshover/archive/2010/04/28/319625.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>閲嶈Thinking in javahttp://www.tkk7.com/birdshover/archive/2009/10/31/300461.htmlBirdshoverBirdshoverSat, 31 Oct 2009 03:51:00 GMThttp://www.tkk7.com/birdshover/archive/2009/10/31/300461.htmlhttp://www.tkk7.com/birdshover/comments/300461.htmlhttp://www.tkk7.com/birdshover/archive/2009/10/31/300461.html#Feedback0http://www.tkk7.com/birdshover/comments/commentRss/300461.htmlhttp://www.tkk7.com/birdshover/services/trackbacks/300461.htmlThinking in java瀵圭戶鎵垮拰緇勫悎鍙堟湁浜嗘柊鐨勮璇嗐傚浣跨敤鐢ㄤ緥鍜屼嬌鐢ㄧ敤渚嬭凱浠d篃鏈変簡鏇存繁鐨勬劅鎮燂紝璁板綍涓涓嬨?/span>

]]>
鎺ュ彛鍨嬶紙緇撴瀯鍨嬶級妯″紡鈥斺旈傞厤鍣ㄦā寮?/title><link>http://www.tkk7.com/birdshover/archive/2009/08/13/290981.html</link><dc:creator>Birdshover</dc:creator><author>Birdshover</author><pubDate>Thu, 13 Aug 2009 04:48:00 GMT</pubDate><guid>http://www.tkk7.com/birdshover/archive/2009/08/13/290981.html</guid><wfw:comment>http://www.tkk7.com/birdshover/comments/290981.html</wfw:comment><comments>http://www.tkk7.com/birdshover/archive/2009/08/13/290981.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/birdshover/comments/commentRss/290981.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/birdshover/services/trackbacks/290981.html</trackback:ping><description><![CDATA[<p align="left">鎺ュ彛鍨嬫ā寮忥紙Interface Pattern錛夛紝鏈夌殑涔︿笂涔熷彨緇撴瀯鍨嬫ā寮?Structural Pattern)銆傞傞厤鍣ㄦā寮忔槸鍏朵腑鐨勪竴縐嶃?br /> <br /> 涓銆佸鎺ュ彛榪涜閫傞厤<br /> <br /> </p> <div align="center"><img height="177" alt="" src="http://www.tkk7.com/images/blogjava_net/birdshover/dd.jpg" width="281" border="0" /><br /> <br /> 鍥?.1</div> 濡傚浘1.1錛屽凡緇忓瓨鍦ㄤ簡ExistsClass瀹炵幇浜嗘兂瑕佺殑鍔熻兘錛屼絾鏄紝鍦ㄤ嬌鐢ㄦ椂鍙兘鏃犳硶浣跨敤錛屽洜姝わ紝鎶婁嬌鐢ㄧ殑鏉′歡鎶借薄涓篈dapter鎺ュ彛錛岀敤AdapterClass緇ф壙鑷狤xistsClass鍚屾椂瀹炵幇鎺ュ彛錛屽畬鎴愬伐浣溿?br /> <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 alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff">package</span><span style="color: #000000"> Interface.Adapter;<br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img id="Codehighlighter1_53_72_Open_Image" onclick="this.style.display='none'; Codehighlighter1_53_72_Open_Text.style.display='none'; Codehighlighter1_53_72_Closed_Image.style.display='inline'; Codehighlighter1_53_72_Closed_Text.style.display='inline';" alt="" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_53_72_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_53_72_Closed_Text.style.display='none'; Codehighlighter1_53_72_Open_Image.style.display='inline'; Codehighlighter1_53_72_Open_Text.style.display='inline';" alt="" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">interface</span><span style="color: #000000"> Adapter </span><span id="Codehighlighter1_53_72_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 alt="" src="http://www.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_53_72_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    </span><span style="color: #0000ff">void</span><span style="color: #000000"> NewWork();<br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span></div> <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 alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff">package</span><span style="color: #000000"> Interface.Adapter;<br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img id="Codehighlighter1_53_113_Open_Image" onclick="this.style.display='none'; Codehighlighter1_53_113_Open_Text.style.display='none'; Codehighlighter1_53_113_Closed_Image.style.display='inline'; Codehighlighter1_53_113_Closed_Text.style.display='inline';" alt="" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_53_113_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_53_113_Closed_Text.style.display='none'; Codehighlighter1_53_113_Open_Image.style.display='inline'; Codehighlighter1_53_113_Open_Text.style.display='inline';" alt="" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> ExistsClass </span><span id="Codehighlighter1_53_113_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 alt="" src="http://www.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_53_113_Open_Text"><span style="color: #000000">{<br /> <img id="Codehighlighter1_74_111_Open_Image" onclick="this.style.display='none'; Codehighlighter1_74_111_Open_Text.style.display='none'; Codehighlighter1_74_111_Closed_Image.style.display='inline'; Codehighlighter1_74_111_Closed_Text.style.display='inline';" alt="" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_74_111_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_74_111_Closed_Text.style.display='none'; Codehighlighter1_74_111_Open_Image.style.display='inline'; Codehighlighter1_74_111_Open_Text.style.display='inline';" alt="" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> Work()</span><span id="Codehighlighter1_74_111_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 alt="" src="http://www.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_74_111_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        System.out.println(</span><span style="color: #000000">"</span><span style="color: #000000">do work!</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span></div> <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 alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff">package</span><span style="color: #000000"> Interface.Adapter;<br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img id="Codehighlighter1_93_188_Open_Image" onclick="this.style.display='none'; Codehighlighter1_93_188_Open_Text.style.display='none'; Codehighlighter1_93_188_Closed_Image.style.display='inline'; Codehighlighter1_93_188_Closed_Text.style.display='inline';" alt="" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_93_188_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_93_188_Closed_Text.style.display='none'; Codehighlighter1_93_188_Open_Image.style.display='inline'; Codehighlighter1_93_188_Open_Text.style.display='inline';" alt="" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> AdapterClass </span><span style="color: #0000ff">extends</span><span style="color: #000000"> ExistsClass </span><span style="color: #0000ff">implements</span><span style="color: #000000"> Adapter </span><span id="Codehighlighter1_93_188_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 alt="" src="http://www.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_93_188_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    @Override<br /> <img id="Codehighlighter1_130_186_Open_Image" onclick="this.style.display='none'; Codehighlighter1_130_186_Open_Text.style.display='none'; Codehighlighter1_130_186_Closed_Image.style.display='inline'; Codehighlighter1_130_186_Closed_Text.style.display='inline';" alt="" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_130_186_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_130_186_Closed_Text.style.display='none'; Codehighlighter1_130_186_Open_Image.style.display='inline'; Codehighlighter1_130_186_Open_Text.style.display='inline';" alt="" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> NewWork() </span><span id="Codehighlighter1_130_186_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 alt="" src="http://www.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_130_186_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #008000">//</span><span style="color: #008000"> TODO Auto-generated method stub</span><span style="color: #008000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">        </span><span style="color: #0000ff">super</span><span style="color: #000000">.Work();<br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span></div> <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 alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff">package</span><span style="color: #000000"> UTest;<br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> junit.framework.TestCase;<br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> Interface.Adapter.Adapter;<br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> Interface.Adapter.AdapterClass;<br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img id="Codehighlighter1_165_251_Open_Image" onclick="this.style.display='none'; Codehighlighter1_165_251_Open_Text.style.display='none'; Codehighlighter1_165_251_Closed_Image.style.display='inline'; Codehighlighter1_165_251_Closed_Text.style.display='inline';" alt="" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_165_251_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_165_251_Closed_Text.style.display='none'; Codehighlighter1_165_251_Open_Image.style.display='inline'; Codehighlighter1_165_251_Open_Text.style.display='inline';" alt="" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> TestAdapter </span><span style="color: #0000ff">extends</span><span style="color: #000000"> TestCase </span><span id="Codehighlighter1_165_251_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 alt="" src="http://www.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_165_251_Open_Text"><span style="color: #000000">{<br /> <img id="Codehighlighter1_193_249_Open_Image" onclick="this.style.display='none'; Codehighlighter1_193_249_Open_Text.style.display='none'; Codehighlighter1_193_249_Closed_Image.style.display='inline'; Codehighlighter1_193_249_Closed_Text.style.display='inline';" alt="" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_193_249_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_193_249_Closed_Text.style.display='none'; Codehighlighter1_193_249_Open_Image.style.display='inline'; Codehighlighter1_193_249_Open_Text.style.display='inline';" alt="" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> testNewWork()</span><span id="Codehighlighter1_193_249_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 alt="" src="http://www.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_193_249_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        Adapter ada </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> AdapterClass();<br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        ada.NewWork();<br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span><span style="color: #000000"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span></div> <p> </p> <p>浜屻佸綾誨璞¤繘琛岄傞厤<br /> </p> <div align="center"><img height="180" alt="" src="http://www.tkk7.com/images/blogjava_net/birdshover/dd1.jpg" width="280" border="0" /><br /> 鍥?.1</div> <p>鍜屾帴鍙e尮閰嶅樊涓嶅錛屼絾瀵瑰凡瀛樺湪綾諱笉鏄戶鎵垮叧緋伙紝鑰屾槸涓縐嶅叧鑱旀垨渚濊禆銆?br /> </p> <img src ="http://www.tkk7.com/birdshover/aggbug/290981.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/birdshover/" target="_blank">Birdshover</a> 2009-08-13 12:48 <a href="http://www.tkk7.com/birdshover/archive/2009/08/13/290981.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>璇﹁ВJavaBeanhttp://www.tkk7.com/birdshover/archive/2009/05/22/277305.htmlBirdshoverBirdshoverFri, 22 May 2009 05:49:00 GMThttp://www.tkk7.com/birdshover/archive/2009/05/22/277305.htmlhttp://www.tkk7.com/birdshover/comments/277305.htmlhttp://www.tkk7.com/birdshover/archive/2009/05/22/277305.html#Feedback0http://www.tkk7.com/birdshover/comments/commentRss/277305.htmlhttp://www.tkk7.com/birdshover/services/trackbacks/277305.html
鍏堝畾涔変竴涓被
package yurow.jstore;

import java.util.Random;

public class TestClass {
    
private int showCount;
    
    
public TestClass(){
        random 
= new Random().nextInt();
    }
    
    
private int random;
    
    
public String Show(){
        showCount
++;
        String str 
= "random : " + random;
        str
+="<br/>showCount : " + showCount;
        
return str;
    }
}

鐒跺悗鍦―efault.jsp涓皟鐢ㄣ?br /> <jsp:useBean id="test1" class="yurow.jstore.TestClass" scope="page" />
<%= test1.Show() %>
<br/>
<jsp:useBean id="test2" class="yurow.jstore.TestClass" scope="page" />
<%= test2.Show() %>
鍦╰est.jsp鍚屾牱浣跨敤榪欐牱鐨勮皟鐢ㄦ柟寮忋?br />
鑰宻cope涓鍏辨湁"application","page","session","request"鍥涗釜鍊箋?br />
涓銆乸age
鐜板湪鐨勬儏鍐墊槸scope="page" 銆傚叾欏甸潰鍒鋒柊銆倀est1鍜宼est2鐨剅andom涓嶄竴鑷達紝騫朵笖涓や釜欏甸潰涓殑涔熶笉涓鑷淬傜敱姝ゆ柇瀹氾細
scope="page"鎯呭喌涓嬶紝涓涓猽serBean灝辨槸涓嬈″疄渚嬪寲鐨勮繃紼嬨?br />
浜屻乺equest
scope="request"鐨勬儏鍐典笌scope="page" 鐨勪竴鏍楓?br />
涓夈乻ession
scope="session"鐨勬儏鍐碉紝鍚屼竴涓〉闈腑錛宼est1涓巘est2鐨剅andom涓嶄竴鑷達紝鍙互鏂畾錛岃繖鏄袱涓疄渚嬨傝宻howCount 浼氫笉鏂瘡鍔狅紝鍥犳榪欎袱涓疄渚嬪茍涓嶉殢欏甸潰鐨勫埛鏂拌岄噸鏂板垱寤恒備袱涓笉鍚岄〉闈腑錛宼est1鐨勭姸鎬佸畬鍏ㄤ竴鑷達紝test2鐨勭姸鎬佸畬鍏ㄤ竴鑷淬傝繖琛ㄦ槑錛宻cope="session"鐨勭姸鎬侊紝鍒涘緩瀹炰緥鏄笌id鐩稿叧鐨勩傛墦寮涓嶅悓嫻忚鍣ㄦ垨鑰呮竻絀篊ookies錛屽皢瀵艱嚧瀹炰緥鐨勯噸鏂板垱寤恒傝繖琛ㄦ槑錛屽綋鍓嶇姸鎬佷笅錛屽垱寤哄疄渚嬩笌session鐩稿叧錛屾湁涓繃鏈熺殑鏃墮棿銆?br />
鍥涖乤pplication
scope="application"鏄叏灞鐨勮〃紺恒傛墦寮涓嶅悓嫻忚鍣ㄦ祻瑙堜笉鍚岀殑欏甸潰錛宼est1涓巘est2浠嶇劧涓嶄竴鑷達紝浣嗘槸涓嶅悓欏甸潰鐨則est1宸茬粡涓鑷達紝騫朵笖涓嶅悓嫻忚鍣ㄤ腑鏁伴噺浠嶇劧绱姞銆傛墍浠ワ紝瀹炰緥鐨勫垱寤轟笌鍚︼紝鍙笌id鏈夊叧銆?

]]>
javascript鏁扮粍涓巎ava鐨勬暟緇?/title><link>http://www.tkk7.com/birdshover/archive/2009/01/16/251552.html</link><dc:creator>Birdshover</dc:creator><author>Birdshover</author><pubDate>Fri, 16 Jan 2009 03:38:00 GMT</pubDate><guid>http://www.tkk7.com/birdshover/archive/2009/01/16/251552.html</guid><wfw:comment>http://www.tkk7.com/birdshover/comments/251552.html</wfw:comment><comments>http://www.tkk7.com/birdshover/archive/2009/01/16/251552.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/birdshover/comments/commentRss/251552.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/birdshover/services/trackbacks/251552.html</trackback:ping><description><![CDATA[瀹氫箟涓涓猨s鐨勬暟緇?br /> var arr = [<br />                     ["1"],<br />                     ["2"]<br />                 ];<br /> 緇忚繃java寮曟搸瑙f瀽鍚庯紝寰楀埌鐨勫璞℃槸sun.org......NativeArray<br /> 鍦ㄦ垜鐨別clipse涓壘涓嶅埌榪欎釜綾匯備篃灝辨病鍔炴硶鐩存帴杞崲鎴恓ava鏁扮粍瀵硅薄浜嗐?br /> <br /> 鐜板湪鎹㈡垚鍦╦s涓嬌鐢╦ava鐨勬暟緇?br /> var result = new java.awt.List();<br /> result.add("aasdasd");<br /> result.add("123123");<br /> <br /> java瑙f瀽錛?br />   ScriptEngineManager m = new ScriptEngineManager();<br />   ScriptEngine engine = m.getEngineByExtension("js");<br />   try {<br />    engine.eval(file.getContent());<br />   } catch (ScriptException e) {<br />    System.out.println("鎵ц鑴氭湰閿欒:" + file.getFileName());<br />    return;<br />   }<br />   List o = (List)engine.get(resultKey);<br />   System.out.print(o.getItem(0));<br /> <br /> 榪欐牱灝辨病鏈夐棶棰樹簡銆? <img src ="http://www.tkk7.com/birdshover/aggbug/251552.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/birdshover/" target="_blank">Birdshover</a> 2009-01-16 11:38 <a href="http://www.tkk7.com/birdshover/archive/2009/01/16/251552.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>java 璋冪敤javascript鑴氭湰(jre6)http://www.tkk7.com/birdshover/archive/2009/01/13/251161.htmlBirdshoverBirdshoverTue, 13 Jan 2009 09:41:00 GMThttp://www.tkk7.com/birdshover/archive/2009/01/13/251161.htmlhttp://www.tkk7.com/birdshover/comments/251161.htmlhttp://www.tkk7.com/birdshover/archive/2009/01/13/251161.html#Feedback4http://www.tkk7.com/birdshover/comments/commentRss/251161.htmlhttp://www.tkk7.com/birdshover/services/trackbacks/251161.html蹇呴』jre6鎵嶈錛岃涓嶉渶瑕佺敤寮婧愬簱浜?/p>
package script;

import javax.script.*;
/**
 * Java璋冪敤JavaScript紺轟緥
 * 
 * 
@author Birdshover
 *
 
*/
public final class scriptMaster {
    
/**
     * 榪愯鎸囧畾鑴氭湰
     * 
@return 榪斿洖鑴氭湰鍊?br />      */
    
public int run() {
        ScriptEngineManager m 
= new ScriptEngineManager();
        ScriptEngine engine 
= m.getEngineByExtension("js");
        
try{
            engine.eval(
"var t=1;t++;");
            engine.eval(
"t++;");
        }
catch(ScriptException ex){
            
return -1;
        }
        Float val 
= Float.parseFloat(engine.get("t").toString());
        
return val.intValue();
    }
}

java璋冪敤javascript,鑰宩avascript鍐呴儴鍙堣皟鐢ㄤ簡java鐨勭被搴撱?br />
    public String now(){
        ScriptEngineManager m 
= new ScriptEngineManager();
        ScriptEngine engine 
= m.getEngineByExtension("js");
        
try{
            engine.eval(
"var t= new java.util.Date();");
        }
catch(ScriptException ex){
            
return (new Date()).toString();
        }
        
return engine.get("t").toString();
    }


]]>
娉涘瀷杞崲綾誨瀷涔婥#涓嶫AVA鐨勫紓鍚?/title><link>http://www.tkk7.com/birdshover/archive/2008/12/09/245255.html</link><dc:creator>Birdshover</dc:creator><author>Birdshover</author><pubDate>Tue, 09 Dec 2008 07:18:00 GMT</pubDate><guid>http://www.tkk7.com/birdshover/archive/2008/12/09/245255.html</guid><wfw:comment>http://www.tkk7.com/birdshover/comments/245255.html</wfw:comment><comments>http://www.tkk7.com/birdshover/archive/2008/12/09/245255.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/birdshover/comments/commentRss/245255.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/birdshover/services/trackbacks/245255.html</trackback:ping><description><![CDATA[鍏充簬綾誨瀷杞崲錛孋#涓嶫AVA鏈澶х殑涓嶅悓鍦ㄤ簬C#鏈塻truct錛岃孞AVA鍒欐病鏈夎繖鐜╂剰銆備簬鏄箮鍦–#涓硾鍨嬬被鍨嬭漿鎹㈠氨鏈変竴涓嬩唬鐮?浠呴檺struct緇撴瀯)銆傚彟澶栦竴涓緝灝忕殑宸紓鍛㈠垯鏄湪C#涓悇struct綾誨瀷閮藉甫鏈塗ryParse鏂規硶錛屽綋鐒訛紝2.0浠ュ悗錛堝寘鎷?.0錛夋墠鏈夈?br /> <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"><span style="color: #0000ff">namespace</span><span style="color: #000000"> DObject.DType<br /> {<br />     </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"><summary></span><span style="color: #008000"><br />     </span><span style="color: #808080">///</span><span style="color: #008000"> 綾誨瀷杞崲甯姪綾伙紝闈欐佹柟娉曞疄鐜般傚姞鍏ヤ簡緙撳瓨鏈哄埗錛屽噺灝戝弽灝勬鏁般?br />     </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"></summary></span><span style="color: #808080"><br /> </span><span style="color: #000000">    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> StaticConvertor<br />     {<br />         </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">const</span><span style="color: #000000"> </span><span style="color: #0000ff">string</span><span style="color: #000000"> CONVERTMETHOD </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000">TryParse</span><span style="color: #000000">"</span><span style="color: #000000">;<br />         </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> Dictionary</span><span style="color: #000000"><</span><span style="color: #000000">System.Type, MethodInfo</span><span style="color: #000000">></span><span style="color: #000000"> map </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> Dictionary</span><span style="color: #000000"><</span><span style="color: #000000">System.Type, MethodInfo</span><span style="color: #000000">></span><span style="color: #000000">(</span><span style="color: #000000">20</span><span style="color: #000000">);<br /> <br />         </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> MethodInfo prepareMethod(System.Type type)<br />         {<br />             </span><span style="color: #0000ff">lock</span><span style="color: #000000"> (map)<br />             {<br />                 </span><span style="color: #0000ff">if</span><span style="color: #000000"> (</span><span style="color: #000000">!</span><span style="color: #000000">map.ContainsKey(type))<br />                 {<br />                     System.Type[] typeArray </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> System.Type[</span><span style="color: #000000">2</span><span style="color: #000000">];<br />                     typeArray.SetValue(</span><span style="color: #0000ff">typeof</span><span style="color: #000000">(</span><span style="color: #0000ff">string</span><span style="color: #000000">), </span><span style="color: #000000">0</span><span style="color: #000000">);<br />                     typeArray.SetValue(type.GetType().MakeByRefType(), </span><span style="color: #000000">1</span><span style="color: #000000">);<br />                     MethodInfo method </span><span style="color: #000000">=</span><span style="color: #000000"> type.GetType().GetMethod(CONVERTMETHOD, typeArray);<br />                     </span><span style="color: #0000ff">if</span><span style="color: #000000"> (method </span><span style="color: #000000">!=</span><span style="color: #000000"> </span><span style="color: #0000ff">null</span><span style="color: #000000">)<br />                     {<br />                         map.Add(type, method);<br />                     }<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: #0000ff">null</span><span style="color: #000000">;<br />                 }<br />                 </span><span style="color: #0000ff">return</span><span style="color: #000000"> map[type];<br />             }<br />         }    </span><span style="color: #008000">//</span><span style="color: #008000">end prepareMethod</span><span style="color: #008000"><br /> </span><span style="color: #000000"><br /> <br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"><summary></span><span style="color: #008000"><br />         </span><span style="color: #808080">///</span><span style="color: #008000"> 杞崲鏂規硶<br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"></summary></span><span style="color: #008000"><br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"><typeparam name="T"></span><span style="color: #008000">杞崲鍚庣被鍨?/span><span style="color: #808080"></typeparam></span><span style="color: #008000"><br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"><param name="raw"></span><span style="color: #008000">鍘熷瀵硅薄</span><span style="color: #808080"></param></span><span style="color: #008000"><br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"><param name="defaultValue"></span><span style="color: #008000">榛樿鍊?/span><span style="color: #808080"></param></span><span style="color: #008000"><br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"><param name="convertSuccessful"></span><span style="color: #008000">鏄惁杞崲鎴愬姛</span><span style="color: #808080"></param></span><span style="color: #008000"><br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"><returns></span><span style="color: #008000">榪斿洖鍊?/span><span style="color: #808080"></returns></span><span style="color: #808080"><br /> </span><span style="color: #000000">        </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> T Convert</span><span style="color: #000000"><</span><span style="color: #000000">T</span><span style="color: #000000">></span><span style="color: #000000">(</span><span style="color: #0000ff">object</span><span style="color: #000000"> raw, T defaultValue, </span><span style="color: #0000ff">out</span><span style="color: #000000"> </span><span style="color: #0000ff">bool</span><span style="color: #000000"> convertSuccessful) where T : </span><span style="color: #0000ff">struct</span><span style="color: #000000"><br />         {<br />             convertSuccessful </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">false</span><span style="color: #000000">;<br />             </span><span style="color: #0000ff">if</span><span style="color: #000000"> (raw </span><span style="color: #000000">==</span><span style="color: #000000"> </span><span style="color: #0000ff">null</span><span style="color: #000000">) </span><span style="color: #008000">//</span><span style="color: #008000">澶辮觸</span><span style="color: #008000"><br /> </span><span style="color: #000000">                </span><span style="color: #0000ff">return</span><span style="color: #000000"> defaultValue;<br />             </span><span style="color: #0000ff">else</span><span style="color: #000000"> </span><span style="color: #0000ff">if</span><span style="color: #000000"> (raw </span><span style="color: #0000ff">is</span><span style="color: #000000"> T) </span><span style="color: #008000">//</span><span style="color: #008000">鎴愬姛</span><span style="color: #008000"><br /> </span><span style="color: #000000">            {<br />                 convertSuccessful </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">true</span><span style="color: #000000">;<br />                 </span><span style="color: #0000ff">return</span><span style="color: #000000"> (T)raw;<br />             }<br />             </span><span style="color: #0000ff">else</span><span style="color: #000000"><br />             {<br />                 </span><span style="color: #0000ff">try</span><span style="color: #000000"><br />                 {<br />                     </span><span style="color: #0000ff">object</span><span style="color: #000000">[] parms </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> </span><span style="color: #0000ff">object</span><span style="color: #000000">[</span><span style="color: #000000">2</span><span style="color: #000000">];<br />                     parms[</span><span style="color: #000000">0</span><span style="color: #000000">] </span><span style="color: #000000">=</span><span style="color: #000000"> raw.ToString();<br />                     parms[</span><span style="color: #000000">1</span><span style="color: #000000">] </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;<br />                     </span><span style="color: #0000ff">bool</span><span style="color: #000000"> isparser </span><span style="color: #000000">=</span><span style="color: #000000"> (</span><span style="color: #0000ff">bool</span><span style="color: #000000">)prepareMethod(</span><span style="color: #0000ff">typeof</span><span style="color: #000000">(T)).Invoke(</span><span style="color: #0000ff">null</span><span style="color: #000000">, parms);<br />                     </span><span style="color: #0000ff">if</span><span style="color: #000000"> (isparser) </span><span style="color: #008000">//</span><span style="color: #008000">鎴愬姛</span><span style="color: #008000"><br /> </span><span style="color: #000000">                    {<br />                         convertSuccessful </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">true</span><span style="color: #000000">;<br />                         </span><span style="color: #0000ff">return</span><span style="color: #000000"> (T)parms[</span><span style="color: #000000">1</span><span style="color: #000000">];<br />                     }<br />                 }<br />                 </span><span style="color: #0000ff">catch</span><span style="color: #000000"><br />                 {<br />                 }<br />                 </span><span style="color: #0000ff">return</span><span style="color: #000000"> defaultValue;<br />             }<br />         } </span><span style="color: #008000">//</span><span style="color: #008000">end Convert<T></span><span style="color: #008000"><br /> </span><span style="color: #000000">    }<br /> }<br /> </span></div> <br /> 浠ヤ笂浠g爜鐨勫啓娉曪紝閫傚悎DateTime,Int32,Int64,Int16,byte,bool絳夈傚彧鏈夋槸struct緇撴瀯錛屽茍涓旀湁TryParse鏂規硶灝卞彲浠ヤ嬌鐢ㄣ傝屼嬌鐢ㄨ搗鏉ュ憿涔熷緢綆鍗曪紝濡備互涓嬩唬鐮?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"><span style="color: #0000ff">namespace</span><span style="color: #000000"> DObject.DType<br /> {<br />     </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"><summary></span><span style="color: #008000"><br />     </span><span style="color: #808080">///</span><span style="color: #008000"> Int32綾誨瀷淇濊瘉<br />     </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"></summary></span><span style="color: #808080"><br /> </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"> DInt32 : DObject, IValuetable</span><span style="color: #000000"><</span><span style="color: #000000">Int32</span><span style="color: #000000">></span><span style="color: #000000">, IConvertSuccess<br />     {<br />         </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">int</span><span style="color: #000000"> target;<br />         </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">int</span><span style="color: #000000"> defaultValue </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">-</span><span style="color: #000000">1</span><span style="color: #000000">;<br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"><summary></span><span style="color: #008000"><br />         </span><span style="color: #808080">///</span><span style="color: #008000"> 鏋勯犲嚱鏁幫紝瀵硅薄鍒濆鍖栨椂錛屽氨鎵ц杞崲<br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"></summary></span><span style="color: #008000"><br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"><param name="o"></param></span><span style="color: #808080"><br /> </span><span style="color: #000000">        </span><span style="color: #0000ff">public</span><span style="color: #000000"> DInt32(</span><span style="color: #0000ff">object</span><span style="color: #000000"> o)<br />             : </span><span style="color: #0000ff">base</span><span style="color: #000000">(o)<br />         {<br />             target </span><span style="color: #000000">=</span><span style="color: #000000"> StaticConvertor.Convert</span><span style="color: #000000"><</span><span style="color: #0000ff">int</span><span style="color: #000000">></span><span style="color: #000000">(</span><span style="color: #0000ff">base</span><span style="color: #000000">.raw, defaultValue, </span><span style="color: #0000ff">out</span><span style="color: #000000"> convertSuccessful);<br />         }<br /> <br />         </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">implicit</span><span style="color: #000000"> </span><span style="color: #0000ff">operator</span><span style="color: #000000"> DInt32(DType type)<br />         {<br />             </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> DInt32(type.RawObject);<br />         }<br /> <br />         </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">bool</span><span style="color: #000000"> convertSuccessful;<br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"><summary></span><span style="color: #008000"><br />         </span><span style="color: #808080">///</span><span style="color: #008000"> 榪斿洖杞崲鍊?br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"></summary></span><span style="color: #008000"><br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"><returns></span><span style="color: #008000">榪斿洖杞崲鍊鹼紝濡傛灉杞崲鎴愬姛鍒欒繑鍥炲鹼紱杞崲澶辮觸榪斿洖榛樿鍊?nbsp;-1</span><span style="color: #808080"></returns></span><span style="color: #808080"><br /> </span><span style="color: #000000">        </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">int</span><span style="color: #000000"> Value()<br />         {<br />             </span><span style="color: #0000ff">return</span><span style="color: #000000"> Value(defaultValue);<br />         }<br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"><summary></span><span style="color: #008000"><br />         </span><span style="color: #808080">///</span><span style="color: #008000"> 榪斿洖杞崲鍊?br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"></summary></span><span style="color: #008000"><br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"><param name="defaultValue"></span><span style="color: #008000">榛樿鍊?/span><span style="color: #808080"></param></span><span style="color: #008000"><br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"><returns></span><span style="color: #008000">榪斿洖杞崲鍊鹼紝濡傛灉杞崲鎴愬姛鍒欒繑鍥炲鹼紱杞崲澶辮觸榪斿洖榛樿鍊?/span><span style="color: #808080"></returns></span><span style="color: #808080"><br /> </span><span style="color: #000000">        </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">int</span><span style="color: #000000"> Value(</span><span style="color: #0000ff">int</span><span style="color: #000000"> defaultValue)<br />         {<br />             </span><span style="color: #0000ff">if</span><span style="color: #000000"> (convertSuccessful)<br />                 </span><span style="color: #0000ff">return</span><span style="color: #000000"> target;<br />             </span><span style="color: #0000ff">return</span><span style="color: #000000"> defaultValue;<br />         }<br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"><summary></span><span style="color: #008000"><br />         </span><span style="color: #808080">///</span><span style="color: #008000"> 鏄惁杞崲鎴愬姛<br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"></summary></span><span style="color: #808080"><br /> </span><span style="color: #000000">        </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">bool</span><span style="color: #000000"> ConvertSuccess<br />         {<br />             </span><span style="color: #0000ff">get</span><span style="color: #000000"> { </span><span style="color: #0000ff">return</span><span style="color: #000000"> convertSuccessful; }<br />         }<br />     }<br /> }<br /> </span></div> <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"><span style="color: #000000">    </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"><summary></span><span style="color: #008000"><br />     </span><span style="color: #808080">///</span><span style="color: #008000"> 鏋勯犵被鍨嬶紝涓哄唴緗被鍨嬫彁渚涙瀯閫犲弬鏁般?br />     </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"><example></span><span style="color: #008000"><br />     </span><span style="color: #808080">///</span><span style="color: #008000">        DInt32 int32 = DType.Default("123");<br />     </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"></example></span><span style="color: #008000"><br />     </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"></summary></span><span style="color: #808080"><br /> </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"> DType<br />     {<br />         </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">object</span><span style="color: #000000"> o;<br /> <br />         </span><span style="color: #0000ff">private</span><span style="color: #000000"> DType(</span><span style="color: #0000ff">object</span><span style="color: #000000"> o)<br />         {<br />             </span><span style="color: #0000ff">this</span><span style="color: #000000">.o </span><span style="color: #000000">=</span><span style="color: #000000"> o;<br />         }<br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"><summary></span><span style="color: #008000"><br />         </span><span style="color: #808080">///</span><span style="color: #008000"> 鎻愪緵瀵硅薄鏋勯犲弬鏁?br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"></summary></span><span style="color: #008000"><br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"><param name="o"></param></span><span style="color: #008000"><br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"><returns></returns></span><span style="color: #808080"><br /> </span><span style="color: #000000">        </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> DType Default(</span><span style="color: #0000ff">object</span><span style="color: #000000"> o)<br />         {<br />             </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> DType(o);<br />         }<br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"><summary></span><span style="color: #008000"><br />         </span><span style="color: #808080">///</span><span style="color: #008000"> 鍘熷瀵硅薄<br />         </span><span style="color: #808080">///</span><span style="color: #008000"> </span><span style="color: #808080"></summary></span><span style="color: #808080"><br /> </span><span style="color: #000000">        </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">object</span><span style="color: #000000"> RawObject<br />         {<br />             </span><span style="color: #0000ff">get</span><span style="color: #000000"> { </span><span style="color: #0000ff">return</span><span style="color: #000000"> o; }<br />         }<br />     }</span></div> <br /> 浣跨敤璧鋒潵涔熸槸綆鍗曪細<br /> DInt32 int32 = DType.Default("123");<br /> int val = int32.Value();<br /> <br /> Java閲屽氨娌¤繖鏍風殑浜嗭紝浣跨敤try鎹曡幏閿欒騫墮潪鎯寵鐨勩俲ava閲屾病鏈塻truct錛屼絾鏄湁涓被鍨婲umber紜槸鍙互浣跨敤銆傚綋鐒訛紝榪欏氨涓嶈兘鍍廋#涓鏍峰皢涔變竷鍏碂鐨勪笢瑗塊兘鏁翠竴鍧椾簡錛岃鍒嗗紑鏉ュ鐞嗕簡銆?br /> <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"><span style="color: #008000">/**</span><span style="color: #008000"><br />  *<br />  * </span><span style="color: #808080">@author</span><span style="color: #008000"> yurow<br />  </span><span style="color: #008000">*/</span><span style="color: #000000"><br /> </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> DNumber </span><span style="color: #0000ff">extends</span><span style="color: #000000"> DObject {<br /> <br />     </span><span style="color: #008000">/**</span><span style="color: #008000"><br />      * Create new instance of DNumber<br />      </span><span style="color: #008000">*/</span><span style="color: #000000"><br />     </span><span style="color: #0000ff">protected</span><span style="color: #000000"> DNumber() {<br />         </span><span style="color: #0000ff">super</span><span style="color: #000000">();<br />     }<br /> <br />     </span><span style="color: #0000ff">protected</span><span style="color: #000000"> DNumber(Object obj)<br />     {<br />         </span><span style="color: #0000ff">super</span><span style="color: #000000">(obj);<br />     }<br />     <br />     </span><span style="color: #0000ff">protected</span><span style="color: #000000"> Boolean isconvert;<br /> <br />     </span><span style="color: #0000ff">public</span><span style="color: #000000"> Number Convert(Number defaultValue) {<br />         isconvert </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">false</span><span style="color: #000000">;<br />         </span><span style="color: #0000ff">if</span><span style="color: #000000"> (obj </span><span style="color: #000000">==</span><span style="color: #000000"> </span><span style="color: #0000ff">null</span><span style="color: #000000">) {<br />             </span><span style="color: #0000ff">return</span><span style="color: #000000"> defaultValue;<br />         } </span><span style="color: #0000ff">else</span><span style="color: #000000"> </span><span style="color: #0000ff">if</span><span style="color: #000000"> (obj </span><span style="color: #0000ff">instanceof</span><span style="color: #000000"> Number) {<br />             isconvert </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">true</span><span style="color: #000000">;<br />             </span><span style="color: #0000ff">return</span><span style="color: #000000"> Number.</span><span style="color: #0000ff">class</span><span style="color: #000000">.cast(obj);<br />         } </span><span style="color: #0000ff">else</span><span style="color: #000000"> {<br />             </span><span style="color: #0000ff">return</span><span style="color: #000000"> defaultValue;<br />         }<br />     }<br /> }<br /> </span></div> <br /> <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"><span style="color: #008000">/**</span><span style="color: #008000"><br />  *<br />  * </span><span style="color: #808080">@author</span><span style="color: #008000"> yurow<br />  </span><span style="color: #008000">*/</span><span style="color: #000000"><br /> </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> DInt32 </span><span style="color: #0000ff">extends</span><span style="color: #000000"> DNumber {<br /> <br />     </span><span style="color: #008000">/**</span><span style="color: #008000"><br />      * Create new instance of DInt32<br />      </span><span style="color: #008000">*/</span><span style="color: #000000"><br />     </span><span style="color: #0000ff">protected</span><span style="color: #000000"> DInt32() {<br />         </span><span style="color: #0000ff">super</span><span style="color: #000000">();<br />     }<br /> <br />     </span><span style="color: #0000ff">protected</span><span style="color: #000000"> DInt32(Object obj) {<br />         </span><span style="color: #0000ff">super</span><span style="color: #000000">(obj);<br />     }<br /> <br />     </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> DInt32 newInt32(Object obj) {<br />         </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> DInt32(obj);<br />     }<br /> <br />     </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">int</span><span style="color: #000000"> Convert()<br />     {<br />         </span><span style="color: #0000ff">return</span><span style="color: #000000"> </span><span style="color: #0000ff">super</span><span style="color: #000000">.Convert(</span><span style="color: #000000">-</span><span style="color: #000000">1</span><span style="color: #000000">).intValue();<br />     }<br /> }<br /> </span></div> <br /> 鍙互鐪嬪嚭錛孞AVA鐨勭被鍨嬮昏緫灞傛鍒掑垎姣擟#瑕佺粏鑷達紝澶勭悊璧鋒潵褰撶劧瑕佸鏉備竴浜涖傚彲瑙佺矑搴﹀茍闈炶秺緇嗚秺濂姐傝傳閬撶湅鏉AVA鍊懼悜浜庢寜閫昏緫鍒掑垎錛岃孋#鍊懼悜浜庢寜鍐呭瓨甯冨眬鍒掑垎銆? <img src ="http://www.tkk7.com/birdshover/aggbug/245255.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/birdshover/" target="_blank">Birdshover</a> 2008-12-09 15:18 <a href="http://www.tkk7.com/birdshover/archive/2008/12/09/245255.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍙嶅皠瀛楁鑾峰彇鎵鏈夊瓧孌佃緭鍑?/title><link>http://www.tkk7.com/birdshover/archive/2008/12/08/245069.html</link><dc:creator>Birdshover</dc:creator><author>Birdshover</author><pubDate>Mon, 08 Dec 2008 09:55:00 GMT</pubDate><guid>http://www.tkk7.com/birdshover/archive/2008/12/08/245069.html</guid><wfw:comment>http://www.tkk7.com/birdshover/comments/245069.html</wfw:comment><comments>http://www.tkk7.com/birdshover/archive/2008/12/08/245069.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.tkk7.com/birdshover/comments/commentRss/245069.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/birdshover/services/trackbacks/245069.html</trackback:ping><description><![CDATA[<div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: rgb(0, 0, 0);">    @Override<br />     </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> String toString() {<br />         StringBuffer buffer </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> StringBuffer();<br />         </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">榪斿洖鎵鏈夊瓧孌?/span><span style="color: rgb(0, 128, 0);"><br /> </span><span style="color: rgb(0, 0, 0);">        Field[] fields </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">.getClass().getDeclaredFields();<br />         </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);"> (</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> i </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">; i </span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);"> fields.length; i</span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);">) {<br />             </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">褰撳墠瀛楁鍚嶇О</span><span style="color: rgb(0, 128, 0);"><br /> </span><span style="color: rgb(0, 0, 0);">            String name </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> fields[i].getName();<br />             buffer.append(name);<br />             buffer.append(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">:</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />             </span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"> {<br />                 </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">褰撳墠瀹炰緥璇ュ瓧孌靛?/span><span style="color: rgb(0, 128, 0);"><br /> </span><span style="color: rgb(0, 0, 0);">                buffer.append(fields[i].get(</span><span style="color: rgb(0, 0, 255);">this</span><span style="color: rgb(0, 0, 0);">));<br />             } </span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"> (Exception ex) {<br />                 System.out.println(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">err:</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> ex.getMessage());<br />             }<br />             buffer.append(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">\n</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />         }<br />         </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> buffer.toString();<br />     }</span></div> <img src ="http://www.tkk7.com/birdshover/aggbug/245069.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/birdshover/" target="_blank">Birdshover</a> 2008-12-08 17:55 <a href="http://www.tkk7.com/birdshover/archive/2008/12/08/245069.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Eclipse System.in瀵逛腑鏂囪緭鍏ユ硶鏀寔涓嶅濂?/title><link>http://www.tkk7.com/birdshover/archive/2008/12/05/244601.html</link><dc:creator>Birdshover</dc:creator><author>Birdshover</author><pubDate>Fri, 05 Dec 2008 06:55:00 GMT</pubDate><guid>http://www.tkk7.com/birdshover/archive/2008/12/05/244601.html</guid><wfw:comment>http://www.tkk7.com/birdshover/comments/244601.html</wfw:comment><comments>http://www.tkk7.com/birdshover/archive/2008/12/05/244601.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/birdshover/comments/commentRss/244601.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/birdshover/services/trackbacks/244601.html</trackback:ping><description><![CDATA[<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_23_216_Open_Image" onclick="this.style.display='none'; Codehighlighter1_23_216_Open_Text.style.display='none'; Codehighlighter1_23_216_Closed_Image.style.display='inline'; Codehighlighter1_23_216_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_23_216_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_23_216_Closed_Text.style.display='none'; Codehighlighter1_23_216_Open_Image.style.display='inline'; Codehighlighter1_23_216_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> testclass </span><span id="Codehighlighter1_23_216_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_23_216_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">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> main(String[] args) </span><span style="color: #0000ff">throws</span><span style="color: #000000"> IOException<br /> <img id="Codehighlighter1_85_214_Open_Image" onclick="this.style.display='none'; Codehighlighter1_85_214_Open_Text.style.display='none'; Codehighlighter1_85_214_Closed_Image.style.display='inline'; Codehighlighter1_85_214_Closed_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_85_214_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_85_214_Closed_Text.style.display='none'; Codehighlighter1_85_214_Open_Image.style.display='inline'; Codehighlighter1_85_214_Open_Text.style.display='inline';" src="http://www.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </span><span id="Codehighlighter1_85_214_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_85_214_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">byte</span><span style="color: #000000">[] buffer </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> </span><span style="color: #0000ff">byte</span><span style="color: #000000">[</span><span style="color: #000000">1024</span><span style="color: #000000">];<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">int</span><span style="color: #000000"> count </span><span style="color: #000000">=</span><span style="color: #000000"> System.in.read(buffer);<br /> <img src="http://www.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        System.out.print(</span><span style="color: #0000ff">new</span><span style="color: #000000"> String(buffer,</span><span style="color: #000000">0</span><span style="color: #000000">,count,</span><span style="color: #000000">"</span><span style="color: #000000">gbk</span><span style="color: #000000">"</span><span style="color: #000000">));<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></div> <br /> 榪欐牱涓孌典唬鐮侊紝鍦ㄨ緭鍏ヤ腑鏂囨椂錛屽鏋滆緭鍏?#8220;ces”鐒跺悗鏁茬┖鏍鹼紝寰楀埌“嫻嬭瘯”榪欎袱涓瓧錛宔nter錛岀劧鍚庤緭鍑?br /> “ces嫻嬭瘯”銆?br /> <br /> 瑕佹槸鐢–onsole榪愯錛宩ava testclass 鍒欐病鏈夎繖縐嶉棶棰? <img src ="http://www.tkk7.com/birdshover/aggbug/244601.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/birdshover/" target="_blank">Birdshover</a> 2008-12-05 14:55 <a href="http://www.tkk7.com/birdshover/archive/2008/12/05/244601.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Hibernate ,Serverlet POST鏌ヨhttp://www.tkk7.com/birdshover/archive/2008/11/26/242888.htmlBirdshoverBirdshoverWed, 26 Nov 2008 14:18:00 GMThttp://www.tkk7.com/birdshover/archive/2008/11/26/242888.htmlhttp://www.tkk7.com/birdshover/comments/242888.htmlhttp://www.tkk7.com/birdshover/archive/2008/11/26/242888.html#Feedback0http://www.tkk7.com/birdshover/comments/commentRss/242888.htmlhttp://www.tkk7.com/birdshover/services/trackbacks/242888.html        try {
            String username 
= request.getParameter("username");
            String password 
= request.getParameter("password");
            SessionFactory sf 
= DefaultDataUtil.getSessionFactory();
            Session s 
= sf.openSession();
            Query query 
= s.createQuery("from Users where username=:name");
            query.setParameter(
"name", username);
            List list 
= query.list();
            
if(list.size() == 1)
            {
                Object o 
= list.get(0);
                Users user 
= (Users)o;
                
if(user.getPassword().equals(password) )
                {
                    out.print(
"楠岃瘉鎴愬姛銆?/span>");
                }
                
else
                {
                    out.print(
"瀵嗙爜閿欒銆?/span>");
                }
            }
            
else
            {
                out.print(
"鐢ㄦ埛鍚嶉敊璇?/span>");
            }
        }
        
catch(Exception ex){
            out.print(ex.getMessage());
        }
        
finally {
            out.close();
        }

HQL璇彞瀵逛簬琛ㄥ悕鏈夊ぇ灝忓啓鍖歸厤鐨勫叧緋伙紝鍖歸厤鐨勬槧灝勮繃鏉ョ殑綾誨悕銆傚惁鍒欎細鎶xx not mapped....閿欒銆傚叾瀹冪殑榪樻槸寰堢畝鍗曠殑銆?

]]>
主站蜘蛛池模板: 亚洲欧洲日产韩国在线| 亚洲av无码国产精品色午夜字幕| 亚洲精品无码久久毛片波多野吉衣 | 亚洲av无码专区在线播放| 一级人做人a爰免费视频| 亚洲国产a级视频| 色婷婷精品免费视频| 亚洲第一黄色网址| xxxxx做受大片视频免费| 亚洲中文久久精品无码ww16| 男女拍拍拍免费视频网站| 亚洲综合精品香蕉久久网| a视频在线免费观看| 亚洲成人在线网站| 国产高清免费视频| 亚洲字幕AV一区二区三区四区| 成人毛片手机版免费看| 男男gvh肉在线观看免费| 亚洲一区二区三区成人网站| 狠狠久久永久免费观看| 最新亚洲人成无码网www电影| vvvv99日韩精品亚洲| 四虎国产精品免费永久在线| 精品国产麻豆免费人成网站| 精品免费国产一区二区| 老司机午夜性生免费福利 | 免费人成在线观看网站品爱网日本 | 亚洲中文字幕久久精品无码A| 日本免费高清一本视频| 一级特黄a大片免费| 亚洲va久久久噜噜噜久久天堂 | 亚洲av无码成人精品区一本二本| 成人亚洲综合天堂| 免费精品99久久国产综合精品| 久久久久亚洲AV无码专区首JN | 午夜寂寞在线一级观看免费| gogo免费在线观看| 亚洲毛片一级带毛片基地| 国产美女a做受大片免费| 成全视频免费观看在线看| 久久精品国产亚洲AV久|