??xml version="1.0" encoding="utf-8" standalone="yes"?>青青草综合网,亚洲伊人成综合成人网,精品国产一区二区三区av片http://www.aygfsteel.com/Good-Game/category/26443.htmlzh-cnMon, 12 May 2008 08:33:25 GMTMon, 12 May 2008 08:33:25 GMT60java regex 正则部分高Ҏ?/title><link>http://www.aygfsteel.com/Good-Game/archive/2008/05/04/197990.html</link><dc:creator>G_G</dc:creator><author>G_G</author><pubDate>Sun, 04 May 2008 01:59:00 GMT</pubDate><guid>http://www.aygfsteel.com/Good-Game/archive/2008/05/04/197990.html</guid><wfw:comment>http://www.aygfsteel.com/Good-Game/comments/197990.html</wfw:comment><comments>http://www.aygfsteel.com/Good-Game/archive/2008/05/04/197990.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.aygfsteel.com/Good-Game/comments/commentRss/197990.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/Good-Game/services/trackbacks/197990.html</trackback:ping><description><![CDATA[q就不介l了 代码上:<br /><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, 255);">package</span><span style="color: rgb(0, 0, 0);"> unit;<br /><br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.util.regex.Matcher;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.util.regex.Pattern;<br /><br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> org.junit.Assert;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> org.junit.Test;<br /><br /></span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);"> RegexUnit {<br /><br /><br />    @Test<br />    </span><span style="color: rgb(0, 128, 0);">/**</span><span style="color: rgb(0, 128, 0);"><br />     * <p>向前\向后查找</p><br />     </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> unit9()</span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);"> Exception{<br />        String testStr </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><b><span style="color: rgb(0, 0, 0);">http://www.google.com</span></b><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br />        <br />        </span><span style="color: rgb(0, 128, 0);">/*</span><span style="color: rgb(0, 128, 0);"> 一般查?br />         * .+(:) 查询出结果包含?<br />         </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br />        Pattern pattern </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> Pattern.compile(</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 />        Matcher matcher </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">  pattern.matcher(testStr);<br />            Assert.assertTrue(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">错误Q 查扑ևl果通过 .+(:) 此regex没有包含 : </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,<br />                    matcher.find() </span><span style="color: rgb(0, 0, 0);">&&</span><span style="color: rgb(0, 0, 0);"> matcher.group().equals(</span><span style="color: rgb(0, 0, 0);">"</span><b><font color="#0000ff"><span style="color: rgb(0, 0, 0);">http:</span></font></b><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">) );<br />        <br />        </span><span style="color: rgb(0, 128, 0);">/*</span><span style="color: rgb(0, 128, 0);">  向前查找<br />         *  .+(?=:) 查询l果不包含?<br />         </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br />        Pattern pattern2 </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> Pattern.compile(</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 />        Matcher matcher2 </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> pattern2.matcher(testStr);<br />            Assert.assertTrue(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">错误Q 查扑ևl果通过 .+(?=:) 此regex有包含? </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,<br />                    matcher2.find()</span><span style="color: rgb(0, 0, 0);">&&</span><span style="color: rgb(0, 0, 0);"> matcher2.group().equals(</span><span style="color: rgb(0, 0, 0);">"</span><b><span style="color: rgb(0, 0, 0);">http</span></b><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);"> 向后查找<br />         * (?<=:).+<br />         </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br />        Pattern pattern3 </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> Pattern.compile(</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 />        Matcher matcher3 </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> pattern3.matcher(testStr);<br />            Assert.assertTrue(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">错误Q查扑ևl果包含 http:// 不向后查?/span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,<br />                    matcher3.find()</span><span style="color: rgb(0, 0, 0);">&&</span><span style="color: rgb(0, 0, 0);"> matcher3.group().equals(</span><span style="color: rgb(0, 0, 0);">"</span><b><span style="color: rgb(0, 0, 0);">www.google.com</span></b><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">) );<br />    }<br /><br /><br />    @Test<br />    </span><span style="color: rgb(0, 128, 0);">/**</span><span style="color: rgb(0, 128, 0);"> 回朔应用 <br />     *  查询回朔、回朔替换、回朔大写替换<br />     </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br />    </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> unit8()</span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);"> Exception{<br />        String testStr </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><b><span style="color: rgb(0, 0, 0);">this is a block of of test,</span></b><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, 0);">"</span><span style="color: rgb(0, 0, 0);"> <b>several words here are are </b></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, 0);">"</span><span style="color: rgb(0, 0, 0);"> <b>repeated , and and they should not be.</b> </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br />        <br />        Pattern pattern </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> Pattern.compile(</span><span style="color: rgb(0, 0, 0);">"</span><b><span style="color: rgb(0, 0, 0);">[ ]+(\\w+)[ ]+\\1</span></b><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />        Matcher matcher </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> pattern.matcher(testStr);<br />        </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">查询l果 <b>are are </b></span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">        Assert.assertTrue(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">错误Qregex 不匹配?/span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">, <br />                matcher.find()</span><span style="color: rgb(0, 0, 0);">&&</span><span style="color: rgb(0, 0, 0);">matcher.group().split(</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);">).length</span><span style="color: rgb(0, 0, 0);">>=</span><span style="color: rgb(0, 0, 0);">2</span><span style="color: rgb(0, 0, 0);"> );<br />        <br />        </span><span style="color: rgb(0, 0, 255);">while</span><span style="color: rgb(0, 0, 0);">( matcher.find() ){<br />            Assert.assertTrue(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">错误Qregex 不匹配?/span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">, <br />                    matcher.group().split(</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);">).length</span><span style="color: rgb(0, 0, 0);">>=</span><span style="color: rgb(0, 0, 0);">2</span><span style="color: rgb(0, 0, 0);"> );<br />        }<br />        <br />        <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 testStr2s </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><b><span style="color: rgb(0, 0, 0);">313-555-1234</span></b><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br />        Pattern pattern2 </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> Pattern.compile(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">(\\d{3})(-)(\\d{3})(-)(\\d{4})</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />        Matcher mtmp </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">  pattern2.matcher(testStr2s);<br />        Assert.assertTrue(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">错误Q没有查替换</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,<br />                mtmp.find() </span><span style="color: rgb(0, 0, 0);">&&</span><span style="color: rgb(0, 0, 0);"> <br />                    mtmp.replaceAll(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">($1) $3-$5</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">).equals(</span><span style="color: rgb(0, 0, 0);">"</span><b><span style="color: rgb(0, 0, 0);">(313) 555-1234</span></b><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">) );<br />        <br />        <br />        </span><span style="color: rgb(0, 128, 0);">/*</span><span style="color: rgb(0, 128, 0);">大小写替?java 不能成功)<br />         *  \E l束 \L 或 \U转换<br />         *  \l  \L 把下一个字W??换ؓ写<br />         *  \ u  \U 把下一个字W??转换为大写?br />         </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br />        String testStr3 </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><b><span style="color: rgb(0, 0, 0);">tt:google:xx</span></b><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br />        Pattern pattern3 </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> Pattern.compile(</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 />        Matcher matcher2 </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> pattern3.matcher(testStr3);<br />        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">( matcher2.find())<br />            System.out.println( matcher2.group() ) ;<br />    }<br />    <br />    <br />}<br /></span></div><br /><br /><br /><img src ="http://www.aygfsteel.com/Good-Game/aggbug/197990.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/Good-Game/" target="_blank">G_G</a> 2008-05-04 09:59 <a href="http://www.aygfsteel.com/Good-Game/archive/2008/05/04/197990.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Hibernate 数据l构Q?树、多对多 l构表示 Q?/title><link>http://www.aygfsteel.com/Good-Game/archive/2008/04/26/196293.html</link><dc:creator>G_G</dc:creator><author>G_G</author><pubDate>Sat, 26 Apr 2008 10:30:00 GMT</pubDate><guid>http://www.aygfsteel.com/Good-Game/archive/2008/04/26/196293.html</guid><wfw:comment>http://www.aygfsteel.com/Good-Game/comments/196293.html</wfw:comment><comments>http://www.aygfsteel.com/Good-Game/archive/2008/04/26/196293.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/Good-Game/comments/commentRss/196293.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/Good-Game/services/trackbacks/196293.html</trackback:ping><description><![CDATA[     摘要: level c:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->package hbm;import java.util.Set;/** * @hibernate.class table = "level" * where = " visible = ...  <a href='http://www.aygfsteel.com/Good-Game/archive/2008/04/26/196293.html'>阅读全文</a><img src ="http://www.aygfsteel.com/Good-Game/aggbug/196293.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/Good-Game/" target="_blank">G_G</a> 2008-04-26 18:30 <a href="http://www.aygfsteel.com/Good-Game/archive/2008/04/26/196293.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>权限设计的探讨阅d?/title><link>http://www.aygfsteel.com/Good-Game/archive/2008/04/07/191376.html</link><dc:creator>G_G</dc:creator><author>G_G</author><pubDate>Mon, 07 Apr 2008 14:49:00 GMT</pubDate><guid>http://www.aygfsteel.com/Good-Game/archive/2008/04/07/191376.html</guid><wfw:comment>http://www.aygfsteel.com/Good-Game/comments/191376.html</wfw:comment><comments>http://www.aygfsteel.com/Good-Game/archive/2008/04/07/191376.html#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://www.aygfsteel.com/Good-Game/comments/commentRss/191376.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/Good-Game/services/trackbacks/191376.html</trackback:ping><description><![CDATA[ <p id="htie" align="center" goog_docs_charindex="1"> <strong id="xz8e"> <font id="aacz" size="5">    权限设计的探讨阅d?/font> </strong> </p> <p id="iwal" align="center" goog_docs_charindex="1"> <strong id="qm7f">    文章路径Q?a id="n3dz" ><font color="#551a8b">http://www.chinaitpower.com/A200508/2005-08-07/183934.html<br /></font></a></strong> </p> <p id="r0vu" align="left" goog_docs_charindex="1">    <strong id="fohi"><font id="d-op" color="#073763">权限设计</font></strong>通常包括数据库设计、应用程序接?API)设计、程序实C个部分?/p> <p id="r3nr" align="left" goog_docs_charindex="1">    <strong id="w.bf"><font id="e2jr" color="#073763">权限分类Q?/font></strong></p> <p id="kvaw" align="left" goog_docs_charindex="1">        首先?strong id="a-fu"><font id="fx9p" color="#000000">针对数据存取</font></strong>的权限,通常有录入、浏览、修攏V删除四U?/p> <p id="h4bi" align="left" goog_docs_charindex="1">        其次?strong id="obi3">功能</strong>Q它可以包括例如l计{所有非直接数据存取操作Q另外,我们q可能对一些关键数据表某些字段的存取进行限制?/p> <p id="uoaw" align="left" goog_docs_charindex="1"> </p> <p id="qt12" align="left" goog_docs_charindex="1"> </p> <p id="kiqc">权限表及相关内容大体可以用六个表来描qͼ如下Q?br id="f:vt" />    1 <font id="m7-o" color="#660000"><strong id="vufz">拥有</strong><strong id="niv7">权限</strong></font><font id="dqei" color="#660000"><strong id="v13-">角色</strong></font>Q即用户l)Q具?strong id="m2-j">拥有</strong>权限<strong id="g6tf">描述</strong>实体?/p> <p id="zrfy">    2 <strong id="at7h"><font id="h1zq" color="#660000">用户?/font></strong>Q用L描述Q其它(如地址、电话等信息Q; <br id="xst3" />    3 <strong id="cyqk"><font id="ij4q" color="#660000">角色-用户对应?/font></strong>Q该表记录用户与角色之间的对应关p?<font id="nmsx" color="#660000">多对多关p?/font>)Q一个用户可以隶属于多个角色Q一个角色组也可拥有多个用户?/p> <p id="k.px">    4 <strong id="t8.v"><font id="tup4" color="#660000">权限列表</font></strong>Q程?strong id="ohbe">所?/strong>权限列表。该表记录所有要加以控制的权限,如录入、修攏V删除、执行等Q?br id="garo" />    5 <strong id="u1ui"><font id="i00i" color="#660000">权限-角色-用户对应?/font></strong>Q?strong id="ome4">权限</strong>对应<strong id="i0mi">角色</strong>(<font id="nmsx" color="#660000">多对多关p?/font>)再由4表关pd<strong id="fl_2">用户</strong>?/p> <p id="iz:a"> </p> <p id="exir"> <strong id="x2pu"> <font id="gc1j" color="#6aa84f">在探讨文中的W?条,我怎么都不太理解?望大家探讨。反向权限吗Q那怎么和系l中的拥有一hqͼ</font> </strong> </p> <p id="ycb7"> </p> <p id="l8-y"> <font id="vvel" color="#274e13"> <strong id="forr">下面提出一些自q见解Q?/strong> </font> </p> <p id="w769"> <font id="hxx0" color="#274e13"> <strong id="egjn">    </strong> </font> <font id="vz4o" color="#000000">1 用户表:用户的描qͼ其它Q如地址、电话等信息Q; </font> </p> <p id="q58-"> <font id="pvhb" color="#000000">   2 权限列表Q程?strong id="n-8.">所?font id="r7ps" color="#660000">权限</font></strong>列表。该表记录所有要加以控制的权限,如录入、修攏V删除、执行等Q?br id="xst3" />   3 权限树(模糊看成<strong id="wlsw">角色</strong>Q但有些不同。树性结构,l构数据库中表外键自己)Q孩子接点承父亲接点全部权限,q在ơ上扩充和删减权限徏立自己分支?/font> </p> <p id="lvyk">   4 权限列表-权限树:Q多对多关系Q用于描q此<strong id="mf:q"><font id="cum4" color="#990000">权限树接?/font></strong>?font id="tu_b" color="#990000"><strong id="a_0.">父亲接点权限l承?/strong></font>Q由<font id="whv." color="#990000"><strong id="sqre">自己d和消减的权限</strong></font>Q?/p> <p id="g6_m">                                        本表中用一列枚丑ֈ用于表示本纪录是d或删减权限?/p> <p id="x_rv">   5 用户-权限树:<strong id="ifkx">权限树接?/strong>对应<strong id="ycou">用户</strong>Q多对一Q关pR?/p> <p id="yaqp">感觉自己的这U框Ӟ能很好的扩充Q在某接点下增,删某权限或直接找?strong id="dwf0">最向近的一个权限树接点q?/strong>Q ?/p> <p id="ur6l" align="right"> <strong id="zg1o">大家多说说自q见解Q和Ҏ下这两个框架的一些优~点把。本人随时恭听。G_G</strong> </p> <p id="yxw." align="right"> <strong id="rssr">?008-4-7 22:50北京<br /></strong> </p> <p id="vs0-" align="right">google doc 原稿Q?a class="tabcontent" id="publishedDocumentUrl" target="_blank">http://docs.google.com/Doc?id=dkvfctc_16hgvfkbfs</a></p> <p id="hfk_"> </p> <img src ="http://www.aygfsteel.com/Good-Game/aggbug/191376.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/Good-Game/" target="_blank">G_G</a> 2008-04-07 22:49 <a href="http://www.aygfsteel.com/Good-Game/archive/2008/04/07/191376.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>快速修?xdoclet samples ant -build.xml 适应实际开?http://www.aygfsteel.com/Good-Game/archive/2008/03/26/188784.htmlG_GG_GWed, 26 Mar 2008 08:29:00 GMThttp://www.aygfsteel.com/Good-Game/archive/2008/03/26/188784.htmlhttp://www.aygfsteel.com/Good-Game/comments/188784.htmlhttp://www.aygfsteel.com/Good-Game/archive/2008/03/26/188784.html#Feedback2http://www.aygfsteel.com/Good-Game/comments/commentRss/188784.htmlhttp://www.aygfsteel.com/Good-Game/services/trackbacks/188784.html使用Q?a id="homepage1_HomePageDays_DaysList_ctl01_DayItem_DayList_ctl00_TitleUrl" href="/Good-Game/archive/2008/03/23/188055.html">xdoclet 2           
            ->   all jar 
            ->   build.xml;build-dist.properties;maven.xml;project.properties;project.xml

开始:
       1.在项目工E?根目录下Z文g夹:xdoclet 拯 *.xml 到此文g?br />       2.在此目录下徏 lib q把 xdoclet  jar 攑օ .
       3.修改 build.xml
    <!-- clean 改ؓ -->
    
<target name="clean">
        
<delete >
            
<fileset dir="${samples.dist.dir}" >
                
<include name="**/*.hbm.xml"/>
            
</fileset>
        
</delete>
    
</target>

    <!-- hibernatedoclet 改ؓ version 3.0 和 include **/*.java-->
        <
hibernatedoclet >
            
<fileset dir="${samples.java.dir}">
                
<include name="**/*.java"/>
            
</fileset>
        
<hibernate version="3.0"/>

hbm2ddl>> http://blog.csdn.net/f1musicc/archive/2006/02/21/604699.aspx
eclipse->>
    ant runtime home + classpath = 到本工程中的 classpath
    ant
runtime home + mysql jar ;
    ant
runtime home + commons-collection.jar
 
    <target name="hbm2ddl">
          
<mkdir dir="${hbm2ddl.sql.dir}" />
          
          
<taskdef name="hbm2ddl"
             classname
="org.hibernate.tool.ant.HibernateToolTask" 
              classpath
="E:\\test\\caijing\\WebRoot\\WEB-INF\\classes"/>
        
          
<hbm2ddl destdir="${hbm2ddl.sql.dir}">
                   
<configuration configurationfile="../src/hibernate.cfg.xml" />
                   
<hbm2ddl export="true" console="false" create="true" update="false" drop="false" outputfilename="bestunix.sql"/>
          
</hbm2ddl> 
        
    
</target>



->target->name=hibernate->hibernate version=3.0
4.修改 build-dist.properties->
    samples.lib.dirQ指定工EjarQ?/font>
   
samples.src.dir/samples.java.dirQ代码所在)
   
samples.gen-src.dir Q映生成地址Q?/font>
        samples.dist.dir = ..\\src\\java\\questionnaire
        samples.lib.dir 
= ..\\lib 
        samples.src.dir = ..\\src\\java\\questionnaire
        samples.java.dir 
= ..\\src\\java\\questionnaire
        samples.gen
-src.dir = ..\\src\\java\\questionnaire

加蝲?eclipse ?ant ?br />调用q个 target 动v来了p栗工作吧Q?br />


G_G 2008-03-26 16:29 发表评论
]]>
xdoclet 2 http://www.aygfsteel.com/Good-Game/archive/2008/03/23/188055.htmlG_GG_GSun, 23 Mar 2008 10:38:00 GMThttp://www.aygfsteel.com/Good-Game/archive/2008/03/23/188055.htmlhttp://www.aygfsteel.com/Good-Game/comments/188055.htmlhttp://www.aygfsteel.com/Good-Game/archive/2008/03/23/188055.html#Feedback2http://www.aygfsteel.com/Good-Game/comments/commentRss/188055.htmlhttp://www.aygfsteel.com/Good-Game/services/trackbacks/188055.html   all XDoclet -> http://xdoclet.sourceforge.net/xdoclet/install.html
   jar 下蝲Q?http://xdoclet.codehaus.org 
   eclipes 插g xdoclet http://www.beust.com/doclipse/

XDoclet 1 一些工?br />   http://xdoclet.sourceforge.net/xdoclet/tools.html

|上demo资料Q?br />   http://www.aygfsteel.com/martinx/archive/2006/01/25/29197.html

XDoclet 2 for Hibernate 3
    http://www.hibernate.org/338.html
    http://www.aygfsteel.com/martinx/archive/2006/01/25/29197.html

XDoclet 2 Tags 说明
   http://xdoclet.codehaus.org/XDoclet+Plugins
XDoclet 1? Ҏ
   http://bbmyth.javaeye.com/blog/31812



大家一PXDoclet 2时代p来到。我们大家一赯上?img src ="http://www.aygfsteel.com/Good-Game/aggbug/188055.html" width = "1" height = "1" />

G_G 2008-03-23 18:38 发表评论
]]>
扒网|据(jdk+正则解析Q?/title><link>http://www.aygfsteel.com/Good-Game/archive/2008/03/09/184796.html</link><dc:creator>G_G</dc:creator><author>G_G</author><pubDate>Sun, 09 Mar 2008 02:46:00 GMT</pubDate><guid>http://www.aygfsteel.com/Good-Game/archive/2008/03/09/184796.html</guid><wfw:comment>http://www.aygfsteel.com/Good-Game/comments/184796.html</wfw:comment><comments>http://www.aygfsteel.com/Good-Game/archive/2008/03/09/184796.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.aygfsteel.com/Good-Game/comments/commentRss/184796.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/Good-Game/services/trackbacks/184796.html</trackback:ping><description><![CDATA[数据扒出效果<br /><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);">双色球(</span><span style="color: rgb(0, 0, 0);">2008001</span><span style="color: rgb(0, 0, 0);">Q?/span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">02</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">04</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">07</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">09</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">14</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">29</span><span style="color: rgb(0, 128, 0);">#</span><span style="color: rgb(0, 128, 0);">03</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">双色球(</span><span style="color: rgb(0, 0, 0);">2008002</span><span style="color: rgb(0, 0, 0);">Q?/span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">03</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">04</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">18</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">22</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">25</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(0, 0, 0);">29</span><span style="color: rgb(0, 128, 0);">#</span><span style="color: rgb(0, 128, 0);">09</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);"><img src="http://www.aygfsteel.com/images/dot.gif" />..</span><span style="color: rgb(0, 0, 0);"><br /></span></div><br />junit代码<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, 255);">package</span><span style="color: rgb(0, 0, 0);"> test;<br /><br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.io.InputStream;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.net.URL;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.net.URLConnection;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.util.regex.Matcher;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> java.util.regex.Pattern;<br /><br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);"> junit.framework.TestCase;<br /><br /></span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);"> HttpConn </span><span style="color: rgb(0, 0, 255);">extends</span><span style="color: rgb(0, 0, 0);"> TestCase {<br />    </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> testT() </span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);"> Exception {<br />        zq :<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);">2008001</span><span style="color: rgb(0, 0, 0);">;</span><span style="color: rgb(0, 0, 255);">true</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);">){<br />            String num </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">  getQihao(i) ;<br />            System.out.println(</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);">+</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);">Q?</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> num);<br />            </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(num</span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">||</span><span style="color: rgb(0, 0, 0);">num.equals(</span><span style="color: rgb(0, 0, 0);">""</span><span style="color: rgb(0, 0, 0);">)) </span><span style="color: rgb(0, 0, 255);">break</span><span style="color: rgb(0, 0, 0);"> zq;<br />        }<br />    }<br />    <br />    </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> String getQihao(</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> qihao) </span><span style="color: rgb(0, 0, 255);">throws</span><span style="color: rgb(0, 0, 0);"> Exception {<br />        URL url </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);"> URL(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">http://www.cnlot.net/ssq/details.php?issue=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">qihao);<br />        URLConnection uconn </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> url.openConnection();<br />        <br />        String num </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 />        <br />        InputStream in </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> uconn.getInputStream();<br />        </span><span style="color: rgb(0, 0, 255);">byte</span><span style="color: rgb(0, 0, 0);">[] bs </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);"> </span><span style="color: rgb(0, 0, 255);">byte</span><span style="color: rgb(0, 0, 0);">[in.available()];<br />        in.read(bs);<br />        String date </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);"> String(bs) ;<br />        <br />        Pattern pa </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> Pattern.compile(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> .+color=red>([0-9][0-9])<.+</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> );<br />        Matcher m </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> pa.matcher(date);<br />        </span><span style="color: rgb(0, 0, 255);">while</span><span style="color: rgb(0, 0, 0);">( m.find() )<br />            num</span><span style="color: rgb(0, 0, 0);">+=</span><span style="color: rgb(0, 0, 0);"> m.group(</span><span style="color: rgb(0, 0, 0);">1</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);">,</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br />        <br />         pa </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> Pattern.compile(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> .+color=blue>([0-9][0-9])<.+</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> );<br />         m </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> pa.matcher(date);<br />        </span><span style="color: rgb(0, 0, 255);">while</span><span style="color: rgb(0, 0, 0);">( m.find() )<br />            num </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> num.substring( </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">,num.length()</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">1</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);">#</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">m.group(</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">) ;<br />        <br />        pa </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> Pattern.compile(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">^(([0-9][0-9],){5,}[0-9][0-9]#([0-9][0-9],)*[0-9][0-9]\\|)*(([0-9][0-9],){5,}[0-9][0-9]#([0-9][0-9],)*[0-9][0-9])*$</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />        m </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">  pa.matcher(num);<br />        </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">( m.find() )<br />            </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> num ;<br />        </span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"> <br />            </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);"> ;<br />    }<br />}<br /></span></div><br /><br /><img src ="http://www.aygfsteel.com/Good-Game/aggbug/184796.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/Good-Game/" target="_blank">G_G</a> 2008-03-09 10:46 <a href="http://www.aygfsteel.com/Good-Game/archive/2008/03/09/184796.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>jdk 旉触发?/title><link>http://www.aygfsteel.com/Good-Game/archive/2008/01/25/177688.html</link><dc:creator>G_G</dc:creator><author>G_G</author><pubDate>Fri, 25 Jan 2008 02:30:00 GMT</pubDate><guid>http://www.aygfsteel.com/Good-Game/archive/2008/01/25/177688.html</guid><wfw:comment>http://www.aygfsteel.com/Good-Game/comments/177688.html</wfw:comment><comments>http://www.aygfsteel.com/Good-Game/archive/2008/01/25/177688.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/Good-Game/comments/commentRss/177688.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/Good-Game/services/trackbacks/177688.html</trackback:ping><description><![CDATA[引用Qhttp://blog.bcchinese.net/shiaohuazhang/archive/2005/02/16/10493.aspx <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);">    timer </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);"> Timer(</span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">);<br />    timer.schedule(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);"> RunTask(), </span><span style="color: rgb(0, 0, 0);">1000</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);">60</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0);">1000</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);">240</span><span style="color: rgb(0, 0, 0);">);<br /><br /><br /></span><span style="color: rgb(0, 128, 0);">////////////////////////////////////<br /></span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);"> RunTask </span><span style="color: rgb(0, 0, 255);">extends</span><span style="color: rgb(0, 0, 0);"> TimerTask {<br />  </span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">boolean</span><span style="color: rgb(0, 0, 0);"> run </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">false</span><span style="color: rgb(0, 0, 0);">;<br />  </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> RunTask() {<br />  }<br />  </span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> run() {<br />       <img src="http://www.aygfsteel.com/images/dot.gif" /><img src="http://www.aygfsteel.com/images/dot.gif" /><img src="http://www.aygfsteel.com/images/dot.gif" /><img src="http://www.aygfsteel.com/images/dot.gif" /><img src="http://www.aygfsteel.com/images/dot.gif" />.<br />  }<br />  </span><span style="color: rgb(0, 0, 255);">private</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);"> Logger logger </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> Logger.getLogger(RunTask.</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">);<br />}<br /></span></div><br /><img src ="http://www.aygfsteel.com/Good-Game/aggbug/177688.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/Good-Game/" target="_blank">G_G</a> 2008-01-25 10:30 <a href="http://www.aygfsteel.com/Good-Game/archive/2008/01/25/177688.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>tomcat 配置 jndi http://www.aygfsteel.com/Good-Game/archive/2008/01/24/177485.htmlG_GG_GThu, 24 Jan 2008 06:12:00 GMThttp://www.aygfsteel.com/Good-Game/archive/2008/01/24/177485.htmlhttp://www.aygfsteel.com/Good-Game/comments/177485.htmlhttp://www.aygfsteel.com/Good-Game/archive/2008/01/24/177485.html#Feedback0http://www.aygfsteel.com/Good-Game/comments/commentRss/177485.htmlhttp://www.aygfsteel.com/Good-Game/services/trackbacks/177485.html ☆づ(18246131) 14:02:45 web.xml,server.xml 讨厌(370801149) 14:02:57 server.xml ☆づ(18246131) 14:02:58 q两个地方,你都配置了吗Q? 讨厌(370801149) 14:03:01 en 讨厌(370801149) 14:03:14 jdbc icijavax.sql.DataSourceContainer 讨厌(370801149) 14:03:17 web.xml 讨厌(370801149) 14:03:28 WEB-INF/web.xml 讨厌(370801149) 14:03:33 context.xml

G_G 2008-01-24 14:12 发表评论
]]>
java,javascript 内连取数?/title><link>http://www.aygfsteel.com/Good-Game/archive/2008/01/09/173895.html</link><dc:creator>G_G</dc:creator><author>G_G</author><pubDate>Wed, 09 Jan 2008 01:46:00 GMT</pubDate><guid>http://www.aygfsteel.com/Good-Game/archive/2008/01/09/173895.html</guid><wfw:comment>http://www.aygfsteel.com/Good-Game/comments/173895.html</wfw:comment><comments>http://www.aygfsteel.com/Good-Game/archive/2008/01/09/173895.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/Good-Game/comments/commentRss/173895.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/Good-Game/services/trackbacks/173895.html</trackback:ping><description><![CDATA[java 内连<br /><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);">            <font color="#008000">//?java jdk URL </font><br />            URL httpurl </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);"> URL(url);<br />            HttpURLConnection httpConn </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br />            httpConn </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> (HttpURLConnection) httpurl.openConnection();<br />            httpConn.setRequestMethod(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">POST</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />            httpConn.setDoOutput(</span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">);<br />            httpConn.setDoInput(</span><span style="color: rgb(0, 0, 255);">true</span><span style="color: rgb(0, 0, 0);">);<br />            <font color="#006400">//</font></span><font color="#008000"><span style="color: rgb(0, 0, 0);"></span></font><span style="color: rgb(0, 0, 0);"><font color="#006400">正式q接</font><br />            httpConn.getOutputStream();<br />            <font color="#008000">/**输入参数<br />            PrintWriter outs = new PrintWriter(httpConn.getOutputStream());<br />            outs.print("&back_url=" + returnurl);<br />            outs.print("&orderid=" + deposit.getOrderId());<br />            outs.print("&bussinessid=" + SZFConstant.B_ID);<br />            outs.print("&digestString="<br />                    + MD5Util.MD5Encode(SZFConstant.B_ID + deposit.getOrderId()<br />                            + SZFConstant.KEY));<br />            outs.flush();<br />            outs.close();<br /><br />            GET ׃??了?url + 参数<br />            */</font><br />            </span><span style="color: rgb(0, 0, 255);">byte</span><span style="color: rgb(0, 0, 0);">[] bb </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);"> </span><span style="color: rgb(0, 0, 255);">byte</span><span style="color: rgb(0, 0, 0);">[httpConn.getInputStream().available()];<br />            httpConn.getInputStream().read(bb);<br />            <font color="#006400">//取得数据 </font><br />            String str </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);"> String(bb);</span></div><br />javascript 现在q种取法有个名字叫(ajaxQ??<br /><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);"><br /></span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">html</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">head</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">link href</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">http://www.cc168.com.cn/css/index.css</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> rel</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">stylesheet</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> type</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">text/css</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, 0);"><</span><span style="color: rgb(0, 0, 0);">link rel</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">stylesheet</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> href</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">http://www.cc168.com.cn/css/framework.css</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> type</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">text/css</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, 0);"><</span><span style="color: rgb(0, 0, 0);">script language</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">javascript</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 /> <br /> window.onload </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);">()<br /> {<br />  CreateDateSelect();<br /> }<br /><br /> </span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);"> xmlHttp </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">false</span><span style="color: rgb(0, 0, 0);">;<br /> </span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);"> e;<br /> <br /> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">创徏XMLHTTP对象</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);"> getXMLHTTPObj()<br /> {<br />  </span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);"> C </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</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 />  {<br />     C </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);"> ActiveXObject(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Msxml2.XMLHTTP</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);">catch</span><span style="color: rgb(0, 0, 0);">(e)<br />  {<br />   </span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"><br />   {<br />    C </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);"> ActiveXObject(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Microsoft.XMLHTTP</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);">catch</span><span style="color: rgb(0, 0, 0);">(sc)<br />   {<br />    C </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">;<br />   }<br />  }<br />  <br />  </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">( </span><span style="color: rgb(0, 0, 0);">!</span><span style="color: rgb(0, 0, 0);">C </span><span style="color: rgb(0, 0, 0);">&&</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">typeof</span><span style="color: rgb(0, 0, 0);"> XMLHttpRequest </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);">undefined</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> )<br />  {<br />   C </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);"> XMLHttpRequest();<br />  }<br />  <br />  </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> C;<br /> }<br /> <br /> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">调用q程Ҏ</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);"> callServer(e)<br /> { <br />  </span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"><br />  {<br />   </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">( xmlHttp </span><span style="color: rgb(0, 0, 0);">&&</span><span style="color: rgb(0, 0, 0);"> xmlHttp .readyState </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);"> )<br />   {<br />    xmlHttp.abort();<br />   }<br />   <br />   xmlHttp </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> getXMLHTTPObj();<br />   <br />   </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">( xmlHttp )<br />   {<br />    document.getElementById(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">outgroup</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">).style.display </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);">none</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);">    </span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);"> dateSele </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> e.options[e.selectedIndex].value;<br />    document.getElementById(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">date</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">).innerHTML </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> dateSele </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);"> 开攑ּ基金净?/span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br /><br />    </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">构造查询连接字W串</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);"> url </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);">https://www.google.com/accounts/ManageAccount</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br />    <br />    </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">打开q接</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">   </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);">(navigator.appName </span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);"> 'Netscape'){<br />   </span><span style="color: rgb(0, 0, 255);">try</span><span style="color: rgb(0, 0, 0);"> {<br />    netscape.security.PrivilegeManager.enablePrivilege(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">UniversalBrowserRead</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);">catch</span><span style="color: rgb(0, 0, 0);"> (e) {<br />       alert(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">Permission UniversalBrowserRead denied.</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />   }}<br />    xmlHttp.open(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">GET</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">, url, </span><span style="color: rgb(0, 0, 255);">true</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);">    xmlHttp.onreadystatechange </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> updatePage;<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);">    xmlHttp.send(</span><span style="color: rgb(0, 0, 255);">null</span><span style="color: rgb(0, 0, 0);">);<br />   }<br />   </span><span style="color: rgb(0, 0, 255);">else</span><span style="color: rgb(0, 0, 0);"><br />   {<br />    document.getElementById(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">flag</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">).innerHTML </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);">XMLHTTP对象创徏p|</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br />   }<br />  }<br />  </span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"> (e)<br />  {<br />   document.getElementById(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">flag</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">).innerHTML </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);">查询错误:</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);"> e;<br />  }<br /> }<br /> <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);"> </span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);"> updatePage()<br /> {<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, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (xmlHttp.readyState </span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">)<br />   {<br />    document.getElementById(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">flag</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">).innerHTML </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);">正在加蝲q接对象<img src="http://www.aygfsteel.com/images/dot.gif" /><img src="http://www.aygfsteel.com/images/dot.gif" /></span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br />   }<br /><br />   </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (xmlHttp.readyState </span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">2</span><span style="color: rgb(0, 0, 0);">)<br />   {<br />    document.getElementById(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">flag</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">).innerHTML </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);">q接对象加蝲完毕?/span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br />   }<br /><br />   </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (xmlHttp.readyState </span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">3</span><span style="color: rgb(0, 0, 0);">)<br />   {<br />    document.getElementById(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">flag</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">).innerHTML </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);">数据获取?img src="http://www.aygfsteel.com/images/dot.gif" /><img src="http://www.aygfsteel.com/images/dot.gif" /></span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br />   }<br /><br />   </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> (xmlHttp.readyState </span><span style="color: rgb(0, 0, 0);">==</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">4</span><span style="color: rgb(0, 0, 0);">)<br />   {<br />    </span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);"> response </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> xmlHttp.responseText;<br />    document.getElementById(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">out</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">).innerHTML </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);"> response;<br />    document.getElementById(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">outgroup</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">).style.display </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 />   }<br />  }<br />  </span><span style="color: rgb(0, 0, 255);">catch</span><span style="color: rgb(0, 0, 0);"> (e)<br />  {<br />      document.getElementById(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">flag</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">).innerHTML </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);">回调处理错误:</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);"> e;<br />  }<br /> }<br /><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);"> </span><span style="color: rgb(0, 0, 255);">function</span><span style="color: rgb(0, 0, 0);"> CreateDateSelect()<br /> {<br /><br />  </span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);"> html </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);">for</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);"> iYear</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">2005</span><span style="color: rgb(0, 0, 0);">; iYear</span><span style="color: rgb(0, 0, 0);"><=</span><span style="color: rgb(0, 0, 0);">2006</span><span style="color: rgb(0, 0, 0);">; iYear </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);">for</span><span style="color: rgb(0, 0, 0);">( </span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);"> iMonth</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">; iMonth</span><span style="color: rgb(0, 0, 0);"><=</span><span style="color: rgb(0, 0, 0);">12</span><span style="color: rgb(0, 0, 0);">; iMonth </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);">for</span><span style="color: rgb(0, 0, 0);">( </span><span style="color: rgb(0, 0, 255);">var</span><span style="color: rgb(0, 0, 0);"> iDay</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);">; iDay</span><span style="color: rgb(0, 0, 0);"><=</span><span style="color: rgb(0, 0, 0);">31</span><span style="color: rgb(0, 0, 0);">; iDay </span><span style="color: rgb(0, 0, 0);">++</span><span style="color: rgb(0, 0, 0);"> )<br />    { <br />    html[html.length] </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);"><option value=\</span><span style="color: rgb(0, 0, 0);">""</span><span style="color: rgb(0, 0, 0);">  + iYear + </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);">"</span><span style="color: rgb(0, 0, 0);"> + iMonth + </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);">"</span><span style="color: rgb(0, 0, 0);"> + iDay + </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);">></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);"> iYear </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);">q?/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);"> iMonth </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);">?/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);"> iDay </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);">?/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);"> </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"></option></span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">;<br />    }<br />   }<br />  }<br />      <br />  document.getElementById(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">dateSele</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">).innerHTML </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);"><select name=\</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">dateSele\</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> id=\</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">dateSele\</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"> onchange=\</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">callServer(</span><span style="color: rgb(0, 0, 255);">this</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);">"</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);"> html.join(</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);"> </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"></select></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, 0);"></</span><span style="color: rgb(0, 0, 0);">script</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);"><br /></span></div><br /><img src ="http://www.aygfsteel.com/Good-Game/aggbug/173895.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/Good-Game/" target="_blank">G_G</a> 2008-01-09 09:46 <a href="http://www.aygfsteel.com/Good-Game/archive/2008/01/09/173895.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>xdoclet 代码生成http://www.aygfsteel.com/Good-Game/archive/2007/12/24/170123.htmlG_GG_GMon, 24 Dec 2007 09:54:00 GMThttp://www.aygfsteel.com/Good-Game/archive/2007/12/24/170123.htmlhttp://www.aygfsteel.com/Good-Game/comments/170123.htmlhttp://www.aygfsteel.com/Good-Game/archive/2007/12/24/170123.html#Feedback0http://www.aygfsteel.com/Good-Game/comments/commentRss/170123.htmlhttp://www.aygfsteel.com/Good-Game/services/trackbacks/170123.html参考: http://blog.easyjf.com/html/blog/20061127/3290288676803397.htm
官方完整APIQ?Template Language (*.xdt)

因ؓ参考中Q是q是比较复杂的例Q数本h愚钝^_^Q特留一文:
1>ant~辑文g
<?xml version="1.0" encoding="UTF-8"?>
<project name="xdocletExample" default="doall" basedir=".">
    
<property name="basedir" location="E:\ue_test\xdoclet" />
    
<property name="xdoclet.lib.dir" location="D:\hbn\hibernate-3.2\xdoclet-1.2.3\lib" />

    
<property name="gen.src.dir" location="${basedir}/target" />
    
<property name="src.dir" location="${basedir}/src" />
    
<property name="template.dir" location="${basedir}/template" />
    
<property name="customtag.dir" location="${basedir}/bin" />

    
<path id="xdoclet.lib.path">
       
<fileset dir="${xdoclet.lib.dir}" includes="*.jar" />
    
</path>

    
<taskdef name="xdoclet" classname="xdoclet.DocletTask" classpathref="xdoclet.lib.path" />   

    
<target name="init" />

    
<target name="daogener" depends="init">
       
<xdoclet destdir="${gen.src.dir}">
           
<fileset dir="${src.dir}" includes="${cjava.file}" />
           
<template templateFile="${xdt.file}" acceptInterfaces="false" acceptAbstractClasses="false" destinationfile="{0}DAO.java" />
       
</xdoclet>
    
</target>

    
<target name="doall" depends="daogener,daoimplgener" />

</project>

在运行上面文件时候动态输入参?br /> 1.依照?.java 文gQ?cjava.file Q;
 2.依照?.xdt.file 文gQ?xdt.file Q;

比如DOS中输入:
E:\ue_test\xdoclet>ant daogener
-Dxdt.file=template\daointerface.xdt
-Dcjava.file=test\TestXDoclet.java

2.参考的java文gQ简单过头了 呵呵Q?br />
package test;
  
/**
  * @hasRef
  
*/
public class TestXDoclet{
    
/**
     * @ref.model name="sytp"
     
*/
    
private PubSystype sytp;

    
private String gg;
}

3.xdt 模板
  标签解释Q?br />
  <XDtClass:ifHasClassTag tagName="hasRef">判断 java文g中有 @hasRef
 
<XDtField:forAllFields1> 循环查找
 
  2>判断?/font>@ref.model name=。?/span>
  <XDtField:ifHasFieldTag tagName="ref.model" paramName="name">
 
  3>取?/b>
  
<XDtField:fieldTagValue tagName="ref.model" paramName="name" />  

package com.hycs.bs.client.itf;

import java.util.List;

//q是 packageName.className q和好理?/font>
import 
<XDtPackage:packageName />.<XDtClass:className />;

public interface 
<XDtClass:className />DAO {

    //d
    boolean add(
<XDtClass:className /> instance);
    
    //逻辑d
    
<XDtClass:ifHasClassTag tagName="hasRef">
        boolean add(
<XDtClass:className /> instance,
                
<XDtField:forAllFields>
                    
<XDtField:ifHasFieldTag tagName="ref.model" paramName="name"> 
                        String 
<XDtField:fieldTagValue tagName="ref.model" paramName="name" />
                    
</XDtField:ifHasFieldTag>
                
</XDtField:forAllFields>);  
    
</XDtClass:ifHasClassTag>

    //更新
    boolean update(
<XDtClass:className /> instance);


    //得到一个对?/font>
    
<XDtClass:className /> get(String pkid);
}

q行DOS->
E:\ue_test\xdoclet>ant daogener
-Dxdt.file=template\daointerface.xdt
-Dcjava.file=test\TestXDoclet.java

得到的代码:
package com.hycs.bs.client.itf;

import java.util.List;

//q是 packageName.className q和好理?/span>
import test.TestXDoclet;

public interface TestXDocletDAO {

    
//d
    boolean add(TestXDoclet instance);
    
//逻辑d
        boolean add(TestXDoclet instance,String sytp); 
    
//更新
    boolean update(TestXDoclet instance);

    
//得到一个对?/span>
    TestXDoclet get(String pkid);
}








G_G 2007-12-24 17:54 发表评论
]]>
序列化和反序列化对象?数据?/title><link>http://www.aygfsteel.com/Good-Game/archive/2007/11/29/164051.html</link><dc:creator>G_G</dc:creator><author>G_G</author><pubDate>Thu, 29 Nov 2007 09:35:00 GMT</pubDate><guid>http://www.aygfsteel.com/Good-Game/archive/2007/11/29/164051.html</guid><wfw:comment>http://www.aygfsteel.com/Good-Game/comments/164051.html</wfw:comment><comments>http://www.aygfsteel.com/Good-Game/archive/2007/11/29/164051.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.aygfsteel.com/Good-Game/comments/commentRss/164051.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/Good-Game/services/trackbacks/164051.html</trackback:ping><description><![CDATA[ <br /> <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);">    </span> <span style="color: rgb(0, 128, 0);">/*</span> <span style="color: rgb(0, 128, 0);"> <br />     * 对象{化成java.sql.Blob <br />     * 要求 对象是序列化?br />     </span> <span style="color: rgb(0, 128, 0);">*/</span> <span style="color: rgb(0, 0, 0);"> <br />    </span> <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 0);"> java.sql.Blob ObjectToBlob(Object obj) </span> <span style="color: rgb(0, 0, 255);">throws</span> <span style="color: rgb(0, 0, 0);"> IOException{<br />        </span> <span style="color: rgb(0, 0, 255);">try</span> <span style="color: rgb(0, 0, 0);"> {<br />            ByteArrayOutputStream out </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);"> ByteArrayOutputStream();<br />            ObjectOutputStream outputStream </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);"> ObjectOutputStream(out);<br />            outputStream.writeObject(obj);<br />            </span> <span style="color: rgb(0, 0, 255);">byte</span> <span style="color: rgb(0, 0, 0);">[] bytes </span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);"> out.toByteArray();<br />            outputStream.close();<br />            </span> <span style="color: rgb(0, 0, 255);">return</span> <span style="color: rgb(0, 0, 0);"> Hibernate.createBlob(bytes);<br />        } </span> <span style="color: rgb(0, 0, 255);">catch</span> <span style="color: rgb(0, 0, 0);"> (Exception e) {<br />            </span> <span style="color: rgb(0, 128, 0);">//</span> <span style="color: rgb(0, 128, 0);"> TODO: handle exception</span> <span style="color: rgb(0, 128, 0);"> <br /> </span> <span style="color: rgb(0, 0, 0);">            System.out.println(</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">ObjectToBlob</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);">return</span> <span style="color: rgb(0, 0, 0);"> </span> <span style="color: rgb(0, 0, 255);">null</span> <span style="color: rgb(0, 0, 0);">;<br />        }        <br />    }<br />    <br />    <br />    </span> <span style="color: rgb(0, 128, 0);">/*</span> <span style="color: rgb(0, 128, 0);"> <br />     * java.sql.Blob 转化成 对象 相应对?br />     * 要求 对象是序列化?br />     </span> <span style="color: rgb(0, 128, 0);">*/</span> <span style="color: rgb(0, 0, 0);">    <br />    </span> <span style="color: rgb(0, 0, 255);">public</span> <span style="color: rgb(0, 0, 0);"> Object BlobToObject(java.sql.Blob desblob,Object obj) </span> <span style="color: rgb(0, 0, 255);">throws</span> <span style="color: rgb(0, 0, 0);"> IOException{<br />        </span> <span style="color: rgb(0, 0, 255);">try</span> <span style="color: rgb(0, 0, 0);"> {<br />            ObjectInputStream in </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);"> ObjectInputStream(desblob.getBinaryStream());<br />            obj </span> <span style="color: rgb(0, 0, 0);">=</span> <span style="color: rgb(0, 0, 0);">  in.readObject();<br />            in.close();    <br />            </span> <span style="color: rgb(0, 0, 255);">return</span> <span style="color: rgb(0, 0, 0);"> obj;<br />        } </span> <span style="color: rgb(0, 0, 255);">catch</span> <span style="color: rgb(0, 0, 0);"> (Exception e) {<br />            </span> <span style="color: rgb(0, 128, 0);">//</span> <span style="color: rgb(0, 128, 0);"> TODO: handle exception</span> <span style="color: rgb(0, 128, 0);"> <br /> </span> <span style="color: rgb(0, 0, 0);">            System.out.println(</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">BlobToObject</span> <span style="color: rgb(0, 0, 0);">"</span> <span style="color: rgb(0, 0, 0);">);<br />            e.printStackTrace();<br />            </span> <span style="color: rgb(0, 0, 255);">return</span> <span style="color: rgb(0, 0, 0);"> </span> <span style="color: rgb(0, 0, 255);">null</span> <span style="color: rgb(0, 0, 0);">;<br />        }        <br />    }    <br />    <br />    <br /></span> </div> <br /> <br /> <img src ="http://www.aygfsteel.com/Good-Game/aggbug/164051.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/Good-Game/" target="_blank">G_G</a> 2007-11-29 17:35 <a href="http://www.aygfsteel.com/Good-Game/archive/2007/11/29/164051.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>java基础http://www.aygfsteel.com/Good-Game/archive/2007/10/22/155070.htmlG_GG_GMon, 22 Oct 2007 10:34:00 GMThttp://www.aygfsteel.com/Good-Game/archive/2007/10/22/155070.htmlhttp://www.aygfsteel.com/Good-Game/comments/155070.htmlhttp://www.aygfsteel.com/Good-Game/archive/2007/10/22/155070.html#Feedback0http://www.aygfsteel.com/Good-Game/comments/commentRss/155070.htmlhttp://www.aygfsteel.com/Good-Game/services/trackbacks/155070.html接口里面的属性在默认状态下面都?/span>public static

2.    
被声明ؓfinal的变量必d声明时给定初|而在以后的引用中只能dQ不可修攏V?br />

3.  
匿名的内部类是没有名字的内部cR不?/span>extends(l承) 其它c,但一个内部类可以作ؓ一个接口,由另一个内部类实现?br />

4. 
静态内部类Q?/span>Inner ClassQ写成这h可以 在内?new ?Q?static final public class XXXxx
           
1.创徏一?/span>static内部cȝ对象Q不需要一个外部类对象
           
2不能从一?/span>static内部cȝ一个对象访问一个外部类对象

5.

        HashMap cL有分cL者排序。它允许一?/span> null 键和多个 null 倹{?/span>

  Hashtable cM?/span> HashMapQ但是不允许 null 键和 null 倹{它也比 HashMap 慢,因ؓ它是同步的?/span>


6. GC

        System.gc()

        Runtime.getRuntime().gc()


7.重写Overriding和重?/span>Overloading
    如果在子cM定义某方法与其父cL相同的名U和参数Q我们说该方法被重写 (Overriding)?/span>

    如果在一个类中定义了多个同名的方法,它们或有不同的参C数或有不同的参数cdQ则UCؓҎ的重?/span>(Overloading)?/span>Overloaded的方法是可以改变q回值的cd?/span>


8.抽象cL否可l承实体c?/span>(concrete class)

          抽象cL否可l承实体c,但前提是实体cdL明确的构造函?/span>


9.try {}里有一?/span>return语句Q那么紧跟在q个try后的finally {}里的code会不会被执行Q什么时候被执行Q在return前还是后?

  会执行,?/span>return前执行?/span>

      

10.switchQ?/span>expr1Q中Q?/span>expr1是一个整数表辑ּ。因此传递给 switch ?/span> case 语句的参数应该是 int?/span> short?/span> char 或?/span> byte?/span>long,string 都不能作用于swtich?/span>




G_G 2007-10-22 18:34 发表评论
]]>
eclipes javadoc 使用 http://www.aygfsteel.com/Good-Game/archive/2007/10/22/155033.htmlG_GG_GMon, 22 Oct 2007 08:47:00 GMThttp://www.aygfsteel.com/Good-Game/archive/2007/10/22/155033.htmlhttp://www.aygfsteel.com/Good-Game/comments/155033.htmlhttp://www.aygfsteel.com/Good-Game/archive/2007/10/22/155033.html#Feedback0http://www.aygfsteel.com/Good-Game/comments/commentRss/155033.htmlhttp://www.aygfsteel.com/Good-Game/services/trackbacks/155033.html2。javadoc 命o学习
    @author 作?br />    @see 另请参见
        Q?Q、@see "string" ?string"d文本,不生链接?br />        Q?Q、@see <a href="URL#Value">Label</a> 使用HTML标记产生链接
        Q?Q、@see package.class#member Label 使用Java语言的名字package.class #member产生链接?

@version ?br />    @since 从以下版本开
    @param 参数说明

/** */中的开头是注解

   /**
   */  的就q原?在那个上面就为那个注?/dt>

参照Qhttp://java.ccidnet.com/art/3743/20031203/519697_1.html

/** class description
*/


3、Variable Description:描述变量的意义和取值含义?br /> /** var variable description
*/

4、Method Description:标明每个Ҏ的输入、输出参数和q回值类型,说明Ҏ变量取值的含义。相关类文链接?br />
/** method description
* @param var signification Ҏ参数说明
* @exception exception class name throws 说明
* @return return_value return signification return 说明
*/

5、Association Description:兌cL描qͼ在注释当中需要参引其它文描q的地方Q可在相应的注释当中如下插入Q?br /> /** method description

* @param var signification
* @exception exception class name
* @return return_value return signification
* @see package.class#member label
*/

6、包描述文gQ概括描q包的功能和设计概要。ؓ每个包创Z个描q文Ӟ命名为package.htmlQ与包的java文g攑֜一赗?



   



G_G 2007-10-22 16:47 发表评论
]]>
重构 eclips 快键http://www.aygfsteel.com/Good-Game/archive/2007/10/15/152890.htmlG_GG_GMon, 15 Oct 2007 02:21:00 GMThttp://www.aygfsteel.com/Good-Game/archive/2007/10/15/152890.htmlhttp://www.aygfsteel.com/Good-Game/comments/152890.htmlhttp://www.aygfsteel.com/Good-Game/archive/2007/10/15/152890.html#Feedback0http://www.aygfsteel.com/Good-Game/comments/commentRss/152890.htmlhttp://www.aygfsteel.com/Good-Game/services/trackbacks/152890.html1.改名 :  ( alt+shift+R )
2.cȝ?( alt+shift+V )
3.Ҏ上移父类,下移子类 (alt+shift+T) + U/D
4.Ҏ接口化?(alt+shift+T) +T
5.部分代码提升为方?alt+shift+M
6.局部变量提升ؓcd?alt+shift+F

.............

***************************************************************

Ctrl+M:   工作区最大化/最化  
  Alt+/:     提示  
  F3:           察看声明  
  Crtl+1:   修正错误  
   
  Shift+Alt+T:   重构  
  Shift+Alt+M:   提取函数  
  Shift+Alt+R:   重命? 
  Shift+Alt+C:   更改函数标记  
   
  Ctrl+Shitf+F:   格式化代? 


G_G 2007-10-15 10:21 发表评论
]]>
java 文g加蝲 (参?Hibernate 源码 ) http://www.aygfsteel.com/Good-Game/archive/2007/10/10/151745.htmlG_GG_GWed, 10 Oct 2007 06:50:00 GMThttp://www.aygfsteel.com/Good-Game/archive/2007/10/10/151745.htmlhttp://www.aygfsteel.com/Good-Game/comments/151745.htmlhttp://www.aygfsteel.com/Good-Game/archive/2007/10/10/151745.html#Feedback1http://www.aygfsteel.com/Good-Game/comments/commentRss/151745.htmlhttp://www.aygfsteel.com/Good-Game/services/trackbacks/151745.html试 ?C/S  ?实际q行 B/S 造成配置文g 在硬~码时L??br />但看 hibernate 的配|文?可以很好工?Q没办法L?
在框架中 发现 ConfigHelpercvC作用 ?br />l合自己开发需求,写出了自q 带查询文件功能类
扩展的主要部分在 findFileҎ q用了一?单的数据l构有兴的可以看看

 
试Q?/b>
文gskynet.xml
<?xml version="1.0" encoding="UTF-8"?>
<xml-body>
    
<man id='1'>
        
<name>刘凯?/span></name>
        
<avg>24</avg>
    
</man>
    
<man id='2'>
        
<name>heha</name>
        
<avg>25</avg>
    
</man>
</xml-body>

试c?/font>
package test.config;

import org.apache.commons.jxpath.JXPathContext;
import org.apache.commons.jxpath.XMLDocumentContainer;

import junit.framework.TestCase;

public class SkynetConfigTest extends TestCase {

    
protected void setUp() throws Exception {
        
super.setUp();
    }
    
    
public void testConfigFile(){
        System.out.println(
                
//find file in System user.dir -> skynet.xml  
                SkynetConfig.getResourceAsFile(System.getProperty("user.dir") , 
                        
"skynet.xml").getPath()
        );
        System.out.println(
                
//find file in System java.class.path -> skynet.xml 
            SkynetConfig.getResourceAsFile(System.getProperty("java.class.path") , 
                    
"skynet.xml").getPath() 
        );
    }
    
public void testConfigURL(){
            JXPathContext jx 
= JXPathContext.newContext(new XMLDocumentContainer( 
                    
// in System user.dir,java.class.path find  url:skynet
                    SkynetConfig.getResourceAsURL("skynet.xml")   
                ));
            System.out.println( jx.getValue(
"//man[avg='24']/@id") );
            System.out.println( jx.getValue(
"//man[avg='24']/name") );
    }
    
    
public void testConfigStream(){
        System.out.println( SkynetConfig.getResourceAsStream(
"skynet.xml") );
    }
}


l果Q?br />E:\src3\rlzy15\lmisWeb\WEB-INF\classes\test\config\skynet.xml
E:\src3\rlzy15\lmisWeb\WEB-INF\classes\test\config\skynet.xml
1
刘凯?br />java.io.FileInputStream@1551d7f


SkynetConfig c?/span>
package test.config;

import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;

import java.net.URL;

import org.apache.commons.jxpath.JXPathContext;
import org.apache.commons.jxpath.XMLDocumentContainer;
import org.hibernate.util.ConfigHelper;

public class SkynetConfig {
    
    
public static final URL getResourceAsURL(final String path) {
        URL url 
= null;

        
// First, try to locate this resource through the current
        
// context classloader.
        ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
        
if (contextClassLoader!=null) {
            url 
= contextClassLoader.getResource(path);
        }
        
if (url != null)
            
return url;

        
// Next, try to locate this resource through this class's classloader
        url = ConfigHelper.class.getClassLoader().getResource(path);
        
if (url != null)
            
return url;
        
        
// Next, try to locate this resource through the system classloader
        url = ClassLoader.getSystemClassLoader().getResource(path);
        
if(url !=null)
            
return url;
        
        File ff 
= getResourceAsFile(System.getProperty("user.dir") ,path);
        
if(ff==null)
            ff 
= getResourceAsFile(System.getProperty("java.class.path") , path);
        
try {
            url 
= new URL("file:/"+ff.getPath());
        } 
catch (Exception e) {e.printStackTrace();}
        
        
return url;
    }
    
    
public static InputStream getResourceAsStream(final String resource) {
        String stripped 
= resource.startsWith("/"? 
                resource.substring(
1) : resource;
        InputStream stream 
= null
        ClassLoader classLoader 
= Thread.currentThread().getContextClassLoader();
        
if (classLoader!=null) {
            stream 
= classLoader.getResourceAsStream( stripped );
        }
        
if ( stream == null ) {
            SkynetConfig.
class.getResourceAsStream( resource );
        }
        
if ( stream == null ) {
            stream 
= SkynetConfig.class.getClassLoader().getResourceAsStream( stripped );
        }
        
if ( stream == null ) {
            File ff 
= getResourceAsFile(System.getProperty("user.dir") ,resource);
            
if(ff==null)
                ff 
= getResourceAsFile(System.getProperty("java.class.path") , resource);
            
try {
                stream 
= new FileInputStream(ff);
                
if(stream==null)
                    
throw new Exception( resource + " not found" );
            } 
catch (Exception e) {e.printStackTrace();}
        }
        
return stream;
    }
    
    
public static File getResourceAsFile(String str,String findff){
        String[] sfd 
= str.split(";");
        
for(int i=0;i<sfd.length;i++){
            File file 
= new File(sfd[i]);
            
if( file.isDirectory()){
                File[] cfs 
= file.listFiles();
                
for(int j=0;j<cfs.length;j++){
                    File ff 
= findFile(cfs[j],findff);
                    
if(ff==null)continue;
                    
else return ff;
                    
                }
            }
        }
        
return null ;
    }
    
    
private static File findFile(File file,String findff){
        
if(file.isFile() && file.exists() && isFileEqu(file,findff)  ) return file ;
        
else if( file.isDirectory() ){
            File[] cfs 
= file.listFiles();
            
for(int i=0;i<cfs.length;i++){
                File ff 
= findFile(cfs[i],findff);
                
if(ff==null)continue;
                
if( isFileEqu(ff,findff) ){
                    
return ff;
                }
            }
        }
        
return null ;
    }
    
    
private static boolean isFileEqu(File ff,String findff){
        String path 
= ff.getPath().trim() ;
        String findfft 
= findff.trim() ;
        
        
if( path.lastIndexOf( findfft )>0)return true;
        
        
return false;
    }

}





G_G 2007-10-10 14:50 发表评论
]]>
վ֩ģ壺 | | | | ϻ| Ρɽ| | | | | | | | | | | ˰| | Ͷ| | | | | | ǿ| Ͽ| | | Ͷ| Ǩ| | | ױ| | ˼| | | | ޻| | ʯ|