锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产精品亚洲综合专区片高清久久久,亚洲综合亚洲综合网成人,亚洲国产精品午夜电影http://www.tkk7.com/zhouf/articles/433940.htmlZhouFengZhouFengMon, 24 Jun 2019 02:55:00 GMThttp://www.tkk7.com/zhouf/articles/433940.htmlhttp://www.tkk7.com/zhouf/comments/433940.htmlhttp://www.tkk7.com/zhouf/articles/433940.html#Feedback0http://www.tkk7.com/zhouf/comments/commentRss/433940.htmlhttp://www.tkk7.com/zhouf/services/trackbacks/433940.html鍦ㄥ紑鍙戦」鐩殑鏃跺欙紝鏈夎澶氶」鐩粨鏋勯兘鏄樊涓嶅鐨勶紝浣跨敤鐨勬鏋朵篃涓鏍鳳紝spring閰嶇疆鏂囦歡涔熶竴鏍風殑錛屽彧鏄瘡涓」鐩殑鍚嶇О錛屽寘鍚嶇瓑涓嶅悓錛屽鏋滄寜鐓т箣鍓嶇殑鏂規(guī)硶錛屽彲浠ユ嫹璐濅竴涓」鐩紝鐒跺悗鍐嶅仛涓浜涗慨鏀瑰氨濂戒簡銆傝繖涔熶笉鏄笉鍙互錛屽彧鏄垜瑙夊緱錛屽簲璇ヨ繕鏈夋洿甯呯殑鎷涳紝Maven鍙互浣跨敤archetype鍒涘緩欏圭洰錛岄偅鏄惁涔熷彲浠ュ垱寤鴻嚜瀹氫箟緇撴瀯鐨勯」鐩簡錛屾墍浠ュ氨浜嗚В浜嗕竴涓嬮氳繃Maven浣跨敤鐜版湁欏圭洰鍒涘緩欏圭洰妯℃澘銆傚皾璇曚簡涓涓嬶紝寰堜笉閿欙紝鍙互鑷姩澶勭悊鍖呭悕絳夎漿鎹紝鍑犱釜鍛戒護灝卞彲浠ョ敓鎴愰浄鍚岀粨鏋勭殑欏圭洰錛屽湪姝よ褰曚竴涓嬭繃紼?br />

1 鍑嗗濂戒竴涓幇鏈夌殑欏圭洰

鏃㈢劧鍋氫負妯℃澘欏圭洰錛岄噷闈㈢殑閰嶇疆閮芥槸鍋氬ソ浜嗙殑錛屾槸涓涓彲浠ョ敤鐨勯」鐩紝鍔犲叆浜咵clipse鏀寔錛岄」鐩腑鍖呭惈涓浜汦clipse閰嶇疆鏂囦歡錛屾湰渚嬩腑欏圭洰鐩綍涓?br />
D:\workspace\myprj

2 鍒涘緩妯℃澘宸ョ▼

榪涘叆欏圭洰鐩綍鍚庯紝榪愯鐢熸垚archetype鍛戒護
D:\workspace\myprj>mvn archetype:create-from-project
浼氬湪myprj鐩綍涓嬬敓鎴恡arget鐩綍錛屽叾涓嬬敓鎴愬涓嬬洰褰?br />
classes
generated-sources
generated-test-sources
m2e-wtp
maven-status
surefire-reports
test-classes
妯℃澘浠g爜涓昏浣嶄簬generated-sources鐩綍涓?br />

3 淇敼妯℃澘浠g爜

欏圭洰涓殑鎵鏈変唬鐮侀兘浼氳嚜鍔ㄦ浛鎹負鍗犱綅絎︼紝闄や簡Eclipse閰嶇疆鏂囦歡涔嬪錛屾帴涓嬫潵淇敼妯℃澘錛岃繘鍏arget\generated-sources\archetype\src\main\resources\archetype-resources\鐩綍錛屽皢Eclipse閰嶇疆鏂囦歡涔熷姞鍏ュ崰浣嶇錛屼互鏂逛究鏂伴」鐩殑鐢熸垚錛屾瘮濡備慨鏀逛笅闈袱涓枃浠訛紝鍔犲叆鍗犱綅絎rtifactId
鏂囦歡1錛?project
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
        <name>${artifactId}</name>
        <comment></comment>
        <projects>
        </projects>
        <buildSpec>
                <buildCommand>
                        <name>org.eclipse.jdt.core.javabuilder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
                <buildCommand>
                        <name>org.eclipse.wst.common.project.facet.core.builder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
                <buildCommand>
                        <name>org.eclipse.wst.validation.validationbuilder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
                <buildCommand>
                        <name>org.eclipse.m2e.core.maven2Builder</name>
                        <arguments>
                        </arguments>
                </buildCommand>
        </buildSpec>
        <natures>
                <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
                <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
                <nature>org.eclipse.jdt.core.javanature</nature>
                <nature>org.eclipse.m2e.core.maven2Nature</nature>
                <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
                <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
        </natures>
</projectDescription>
鏂囦歡2錛?settings\org.eclipse.wst.common.component
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
    <wb-module deploy-name="${artifactId}">
        <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
        <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
        <property name="context-root" value="${artifactId}"/>
        <property name="java-output-path" value="/${artifactId}/target/classes"/>
    </wb-module>
</project-modules>

4 淇敼欏圭洰鏂囦歡鍒楄〃

閰嶇疆瀹屾垚鍚庯紝閫氳繃mvn鐢熸垚鏂扮殑欏圭洰鏃訛紝涓婇潰鐨凟clipse閰嶇疆鏂囦歡涔熶笉浼氳鏀懼叆鏂扮殑宸ョ▼閲岋紝闇瑕佸湪閰嶇疆鏂囦歡涓姞鍏ヨ繖浜涙枃浠剁殑淇℃伅錛屼互鍙婃爣璁板摢浜涙枃浠舵槸闇瑕佷嬌鐢ㄥ崰浣嶇鏇挎崲鐨勶紝淇敼target\generated-sources\archetype\src\main\resources\META-INF\maven\archetype-metadata.xml鏂囦歡錛屽湪鐜版湁鏂囦歡涓彲浠ョ湅鍒板涓嬩俊鎭?br />
<fileSet filtered="true" encoding="UTF-8">
    <directory>.settings</directory>
    <includes>
        <include>**/*.xml</include>
    </includes>
</fileSet>
涔熷氨鏄錛岄粯璁ゆ儏鍐典笅錛宮vn鍙皢.settings鐩綍涓嬬殑*.xml鏂囦歡鐢熸垚鍒伴」鐩腑錛屽叾涓璮iltered="true"琛ㄧず闇瑕佽繘琛屽唴瀹硅繃婊ゆ浛鎹㈠崰浣嶇錛屾垜浠妸闇瑕佹坊鍔犵殑鏂囦歡鏀懼叆姝ら厤緗紝淇敼鍚庣粨鏋滃涓?/div>
<fileSet filtered="true" encoding="UTF-8">
    <directory>.settings</directory>
    <includes>
        <include>**/*.xml</include>
        <include>**/*.container</include>
        <include>**/*.component</include>
        <include>**/*.name</include>
        <include>**/*.jsdtscope</include>
        <include>**/*.prefs</include>
    </includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
    <directory></directory>
    <includes>
        <include>.classpath</include>
        <include>.project</include>
    </includes>
</fileSet>
濡傛灉闇瑕佽繃婊ゆ帀涓浜涗笉闇瑕佺殑鏂囦歡錛屼篃鍙互鍦ㄦ閰嶇疆銆傚噯澶囧ソ鍚庯紝灝卞彲浠ュ畨瑁呬簡

5 灝嗘ā鏉塊」鐩畨瑁呭埌鏈湴浠撳簱

榪涘叆/target/generated-sources/archetype/鐩綍錛屾墽琛屽畨瑁?br />
D:\workspace\myprj\target\generated-sources\archetype>mvn install
姝ゅ懡浠や細鍦╩aven浠撳簱涓敓鎴恆rchetype-catalog.xml鏂囦歡錛屼粨搴撲綅緗彇鍐充簬maven閰嶇疆鏂囦歡settings.xml涓殑璁劇疆錛屽唴瀹瑰涓嬶紝鍙互淇敼鎻忚堪淇℃伅錛屾柟渚垮湪鍒涘緩欏圭洰鏃惰繘琛屾彁紺?br />
<?xml version="1.0" encoding="UTF-8"?>
<archetype-catalog xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-catalog/1.0.0 http://maven.apache.org/xsd/archetype-catalog-1.0.0.xsd"
    xmlns
="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-catalog/1.0.0"
    xmlns:xsi
="http://www.w3.org/2001/XMLSchema-instance">
  <archetypes>
    <archetype>
      <groupId>com.zhouf</groupId>
      <artifactId>myprj-archetype</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <description>simple project with springmvc and jetty</description>
    </archetype>
  </archetypes>
</archetype-catalog>

6 鍒涘緩欏圭洰嫻嬭瘯

鎵ц鐢熸垚鍛戒護
D:\workspace>mvn archetype:generate -DarchetypeCatalog=local
姝ゅ懡浠ゅ彲浠ュ湪浠諱綍鐩綍涓嬫墽琛岋紝浼氬湪褰撳墠鐩綍鐢熸垚欏圭洰
Choose archetype:
1: local -> com.zhouf:myprj-archetype (simple project with springmvc and jetty)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : 1
Define value for property 'groupId': com.zhouf
Define value for property 'artifactId': demoprj1
Define value for property 'version' 1.0-SNAPSHOT: :
Define value for property 'package' com.zhouf: :
Confirm properties configuration:
groupId: com.zhouf
artifactId: demoprj1
version: 1.0-SNAPSHOT
package: com.zhouf
 Y: :
鐢熸垚欏圭洰demoprj1

7 瀵煎叆Eclipse榪愯

灝嗙敓鎴愮殑欏圭洰瀵煎叆鍒癊clipse鐜涓紝鐩存帴閮ㄧ講鍒版湇鍔″櫒涓婅窇涓涓紝嫻嬭瘯閫氳繃錛屼笉闇瑕佷慨鏀歸厤緗紝甯?/div>
濡傛灉欏圭洰鏄氳繃mvn jetty:run榪愯鐨勶紝涔熷彲浠ョ渷鐣ヤ腑闂村姞鍏clipse閰嶇疆鏂囦歡鐨勬搷浣?/div>
杞嚜鎴戠殑綆涔︼細https://www.jianshu.com/p/fb5c0e39692f


ZhouFeng 2019-06-24 10:55 鍙戣〃璇勮
]]>Tomcat閰嶇疆cgi榪愯python鑴氭湰http://www.tkk7.com/zhouf/articles/433448.htmlZhouFengZhouFengSat, 20 Oct 2018 02:34:00 GMThttp://www.tkk7.com/zhouf/articles/433448.htmlhttp://www.tkk7.com/zhouf/comments/433448.htmlhttp://www.tkk7.com/zhouf/articles/433448.html#Feedback0http://www.tkk7.com/zhouf/comments/commentRss/433448.htmlhttp://www.tkk7.com/zhouf/services/trackbacks/433448.html
1銆佸湪web宸ョ▼WEB-INF鐩綍涓嬪垱寤虹洰褰昪gi錛屽綋鐒朵篃鍙互鏄埆鐨勫悕瀛?/div>
2銆佷慨鏀箇eb.xml錛屽紑鍚涓嬭緗紝榛樿鎯呭喌鏄敞閲婃帀鐨?br />
<servlet>
    <servlet-name>cgi</servlet-name>
    <servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
    <init-param>
        <param-name>clientinputTimeout</param-name>
        <param-value>100</param-value>
    </init-param>
    <init-param>
        <param-name>debug</param-name>
        <param-value>0</param-value>
    </init-param>
    <init-param>
        <param-name>passShellEnvironment</param-name>
        <param-value>true</param-value>
    </init-param>
    <init-param>
        <param-name>cgiPathPrefix</param-name>
        <param-value>WEB-INF/cgi</param-value>
    </init-param>
    <init-param>
        <param-name>executable</param-name>
        <param-value>D:/Anaconda3/python.exe</param-value>
    </init-param>
    <load-on-startup>5</load-on-startup>
</servlet>
娉ㄦ剰淇敼python鐨勮礬寰?/div>
cgiPathPrefix: 涓嶴erver鑳藉璁塊棶鐨勮剼鏈洰褰曟湁鍏籌紝涓庝箣鍓嶅垱寤虹殑鐩綍鐩稿搴?br />
3銆佸紑鍚痗gi鐨刴apping鏄犲皠錛屼慨鏀箇eb.xml錛屽紑鍚涓嬭緗?br />
<servlet-mapping>
    <servlet-name>cgi</servlet-name>
    <url-pattern>/cgi-bin/*</url-pattern>
</servlet-mapping>
璁塊棶璺緞鍙互淇敼涓鴻嚜瀹氫箟瀛楃
4銆佷慨鏀筩ontent.xml鏂囦歡錛屽湪Context涓坊鍔爌rivileged灞炴?br />
<Context privileged="true">

5銆佸湪宸ョ▼cgi鐩綍鍐檖ython鏂囦歡錛屽hello.py
print('Content-type: text/plain\n\n')

print('Hello python')
杈撳嚭text/plain璇存槑榪欐槸涓涓櫘閫氭枃鏈紝涓瀹氭敞鎰忎箣鍚庤鏈変袱涓崲琛岋紙灝忓績鍧戝暒錛夛紒錛侊紒

6銆佽繍琛屽伐紼嬪茍嫻嬭瘯
http://localhost:8080/prj/cgi-bin/hello.py

鎵瑙佺粨鏋滐紝閫氳繃榪欑鏂規(guī)硶鍙互鍦═omcat鐜涓嬭繍琛宲ython鑴氭湰浜嗭紝濡傛灉鏄凡緇忕敤python鑴氭湰鍋氬ソ浜嗘湇鍔$殑璇濓紝榪樻槸鍙互鑰冭檻閫氳繃鏈嶅姟璋冪敤鐨勬柟寮忎笌Tomcat宸ョ▼榪涜鏁村悎錛屽湪姝よ褰曚竴涓?/div>

ZhouFeng 2018-10-20 10:34 鍙戣〃璇勮
]]>緗戦〉璇煶鎾姤鐨勫疄鐜?/title><link>http://www.tkk7.com/zhouf/articles/432483.html</link><dc:creator>ZhouFeng</dc:creator><author>ZhouFeng</author><pubDate>Tue, 25 Apr 2017 10:48:00 GMT</pubDate><guid>http://www.tkk7.com/zhouf/articles/432483.html</guid><wfw:comment>http://www.tkk7.com/zhouf/comments/432483.html</wfw:comment><comments>http://www.tkk7.com/zhouf/articles/432483.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/zhouf/comments/commentRss/432483.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/zhouf/services/trackbacks/432483.html</trackback:ping><description><![CDATA[<div>鍥犱負闇瑕佸疄鐜板湪欏甸潰涓繘琛岃闊蟲彁紺猴紝鏈夌偣鍍忕編鍥㈤偅涓鍗栫殑鎻愮ず闊?#8220;鎮(zhèn)ㄦ湁鏂扮殑璁㈠崟錛岃娉ㄦ剰鏌ユ敹”錛屼簬鏄紑濮嬫悳瀵繪柟娉曪紝鏈鍚庡彂鐜頒竴涓紑婧愰」鐩紝https://github.com/wenco/speech 鐢ㄦ潵瀹炵幇璇煶鎾姤錛屼笂闈㈡湁鏂囨。璇存槑銆傚厛clone涓嬫潵璇曡瘯</div><div>鎸夌収鎵緇欑殑浠g爜錛岃繍琛岃搗鏉ユ病鏈夐棶棰橈紝闇瑕佸湪欏甸潰涓斁鍏ヤ竴涓爣絳撅紝騫跺啓鍏ヨ杞崲涓鴻闊崇殑鍐呭銆備負浜嗗悗闈負浜嗚皟鐢ㄦ柟渚匡紝涓嬮潰榪涜浜嗕竴浜涜皟鏁淬?/div><div>鎶婃挱鏀炬寜閽殣钘忚搗鏉ワ紝璁╀簨浠惰Е鍙戞挱鏀俱?/div><div>淇敼jQuery.speech.min.js錛屽洜欏甸潰寮曠敤鐨勬枃浠舵槸榪欎釜錛屼篃鍙互鍗曠嫭鍒涘緩涓涓猨s鍦ㄩ〉闈腑寮曞叆錛屽啓鍏ヤ互涓嬪唴瀹?br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><span style="color: #008000; ">//</span><span style="color: #008000; ">璇煶鍐呭鏀懼湪欏甸潰鍏冪礌涓紝濡傛灉娌℃湁鍒欏垱寤?lt;div style="display: none" id="tts_content"></div></span><span style="color: #008000; "><br /></span><span style="color: #0000FF; ">function</span> say(arg) {<br /><br />    <span style="color: #008000; ">//</span><span style="color: #008000; ">澶勭悊欏甸潰鍏冪礌</span><span style="color: #008000; "><br /></span>    <span style="color: #0000FF; ">if</span>($("#tts_content").length == 0){<br />        <span style="color: #008000; ">//</span><span style="color: #008000; ">瀛樺湪鍏冪礌</span><span style="color: #008000; "><br /></span>        $("<div style='display: none' id='tts_content'></div>").appendTo("body");<br />    }<br /><br />    <span style="color: #008000; ">//</span><span style="color: #008000; ">澶勭悊浼犲叆鍙傛暟</span><span style="color: #008000; "><br /></span>    <span style="color: #0000FF; ">if</span>(arg){<br />        $('#tts_content').text(arg);<br />    }<span style="color: #0000FF; ">else</span>{<br />        $('#tts_content').text("鎮(zhèn)ㄦ湁鏂扮殑娑堟伅錛岃娉ㄦ剰鏌ユ敹");<br />    }<br />    <br />    <span style="color: #008000; ">//</span><span style="color: #008000; ">杞寲涓鴻闊?/span><span style="color: #008000; "><br /></span>    $('#tts_content').speech({<br />        "speech": <span style="color: #0000FF; ">false</span>,<br />        "speed": 16<br />    });<br />}</div><div>璋冩暣浜嗘挱鎶ラ熷害錛屽湪紼嬪簭涓嚜鍔ㄥ垱寤洪渶瑕佺殑鏍囩錛岄渶瑕佹挱鎶ョ殑鍐呭鏍規(guī)嵁鍙傛暟浼犲叆錛屾病鏈夊弬鏁頒篃鍙互鎾姤榛樿鐨勬秷鎭紝緇忚繃榪欐牱綆鍗曠殑灝佽鍚庯紝鍦ㄨ皟鐢ㄦ椂錛屽氨鍙渶瑕佽皟鐢╯ay()鏂規(guī)硶鍗沖彲錛屼笉闇瑕佸湪欏甸潰涓斁鍏ユ爣絳撅紝涔熸柟渚挎斁鍏ュ叾浠栦簨浠朵腑錛岀劧鍚庨〉闈㈠氨鍙互榪欐牱浜?br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; "><!</span><span style="color: #FF00FF; ">DOCTYPE html</span><span style="color: #0000FF; ">></span><br /><span style="color: #0000FF; "><</span><span style="color: #800000; ">html</span><span style="color: #0000FF; ">></span><br /><span style="color: #0000FF; "><</span><span style="color: #800000; ">head</span><span style="color: #0000FF; ">></span><br /><span style="color: #0000FF; "><</span><span style="color: #800000; ">meta </span><span style="color: #FF0000; ">charset</span><span style="color: #0000FF; ">="utf-8"</span><span style="color: #FF0000; "> </span><span style="color: #0000FF; ">/></span><br /><span style="color: #0000FF; "><</span><span style="color: #800000; ">title</span><span style="color: #0000FF; ">></span>璇煶鎾姤<span style="color: #0000FF; "></</span><span style="color: #800000; ">title</span><span style="color: #0000FF; ">></span><br /><span style="color: #0000FF; "></</span><span style="color: #800000; ">head</span><span style="color: #0000FF; ">></span><br /><span style="color: #0000FF; "><</span><span style="color: #800000; ">body</span><span style="color: #0000FF; ">></span><br /><span style="color: #0000FF; "><</span><span style="color: #800000; ">style </span><span style="color: #FF0000; ">type</span><span style="color: #0000FF; ">="text/css"</span><span style="color: #0000FF; ">></span><span style="background-color: #F5F5F5; color: #800000; "><br />body</span><span style="background-color: #f5f5f5;">{</span><span style="background-color: #F5F5F5; color: #FF0000; ">background-color</span><span style="background-color: #f5f5f5;">:</span><span style="background-color: #F5F5F5; color: #0000FF; ">#fff</span><span style="background-color: #f5f5f5;">;</span><span style="background-color: #F5F5F5; color: #FF0000; ">padding-top</span><span style="background-color: #f5f5f5;">:</span><span style="background-color: #F5F5F5; color: #0000FF; ">50px</span><span style="background-color: #f5f5f5;">;</span><span style="background-color: #f5f5f5;">}</span><span style="background-color: #F5F5F5; color: #800000; "><br /></span><span style="color: #0000FF; "></</span><span style="color: #800000; ">style</span><span style="color: #0000FF; ">></span><br /><span style="color: #0000FF; "><</span><span style="color: #800000; ">script </span><span style="color: #FF0000; ">src</span><span style="color: #0000FF; ">="js/jQuery/jQuery-2.1.4.min.js"</span><span style="color: #0000FF; ">></</span><span style="color: #800000; ">script</span><span style="color: #0000FF; ">></span><br /><span style="color: #0000FF; "><</span><span style="color: #800000; ">script </span><span style="color: #FF0000; ">src</span><span style="color: #0000FF; ">="js/speech/jQuery.speech.min.js"</span><span style="color: #0000FF; ">></</span><span style="color: #800000; ">script</span><span style="color: #0000FF; ">></span><br /><br /><span style="color: #0000FF; "><</span><span style="color: #800000; ">button </span><span style="color: #FF0000; ">id</span><span style="color: #0000FF; ">="kk"</span><span style="color: #0000FF; ">></span>璇翠竴涓?span style="color: #0000FF; "></</span><span style="color: #800000; ">button</span><span style="color: #0000FF; ">></span><br /><span style="color: #0000FF; "><</span><span style="color: #800000; ">script</span><span style="color: #0000FF; ">></span><span style="background-color: #f5f5f5;"><br />$(</span><span style="background-color: #f5f5f5;">"</span><span style="background-color: #f5f5f5;">#kk</span><span style="background-color: #f5f5f5;">"</span><span style="background-color: #f5f5f5;">).click(</span><span style="background-color: #F5F5F5; color: #0000FF; ">function</span><span style="background-color: #f5f5f5;">() {<br />    say(</span><span style="background-color: #f5f5f5;">"</span><span style="background-color: #f5f5f5;">鎮(zhèn)ㄦ湁鏂扮殑璁㈠崟錛岃娉ㄦ剰鏌ユ敹</span><span style="background-color: #f5f5f5;">"</span><span style="background-color: #f5f5f5;">);<br />    </span><span style="background-color: #F5F5F5; color: #008000; ">//</span><span style="background-color: #F5F5F5; color: #008000; ">say();</span><span style="background-color: #F5F5F5; color: #008000; "><br /></span><span style="background-color: #f5f5f5;">});<br /></span><span style="color: #0000FF; "></</span><span style="color: #800000; ">script</span><span style="color: #0000FF; ">></span><br /><span style="color: #0000FF; "></</span><span style="color: #800000; ">body</span><span style="color: #0000FF; ">></span><br /><span style="color: #0000FF; "></</span><span style="color: #800000; ">html</span><span style="color: #0000FF; ">></span></div>娣誨姞鎸夐挳鍙槸涓轟簡婕旂ず浜嬩歡瑙﹀彂錛岄渶瑕佽浠涔堝唴瀹瑰氨浼犲叆浠涔堝弬鏁幫紝濡傛灉涓嶄紶鍏ュ弬鏁幫紝鍒欐挱鎶ラ粯璁ゅ唴瀹廣傝繖鏍風殑璋冪敤錛岀敋鏄畝鍗曪紝緇堜簬瀹屾垚浜嗚繖鏍風殑鍔熻兘錛屽緢甯咃紝鍝堝搱:D</div><div></div><div>鑷磋阿https://github.com/wenco/speech</div></div><img src ="http://www.tkk7.com/zhouf/aggbug/432483.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/zhouf/" target="_blank">ZhouFeng</a> 2017-04-25 18:48 <a href="http://www.tkk7.com/zhouf/articles/432483.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Tomcat+Eclipse鐜涓嬩嬌鐢↗enkins2.38鎼緩鎸佺畫闆嗘垚(CI)鐜http://www.tkk7.com/zhouf/articles/432234.htmlZhouFengZhouFengMon, 02 Jan 2017 03:51:00 GMThttp://www.tkk7.com/zhouf/articles/432234.htmlhttp://www.tkk7.com/zhouf/comments/432234.htmlhttp://www.tkk7.com/zhouf/articles/432234.html#Feedback0http://www.tkk7.com/zhouf/comments/commentRss/432234.htmlhttp://www.tkk7.com/zhouf/services/trackbacks/432234.html

1.涓嬭澆瀹夎Jenkins

鍙互鍦?a target="_blank">http://mirrors.jenkins-ci.org涓婁笅杞藉畨瑁呭寘錛屼篃鍙互閫夋嫨鍦ㄥ畼緗戯紙https://jenkins.io錛変笂涓嬭澆war鍖?http://mirrors.jenkins.io/war-stable/latest/jenkins.war)鎴栨槸瀹夎鍖?http://mirrors.jenkins-ci.org/windows/jenkins-2.38.zip)錛屽啓榪欑瘒鏂囩珷鏃舵渶鏂扮増鏈負2.38銆傚鏋滈夋嫨瀹夎鍖呮柟寮忥紝涓嬭澆鍚庡畨瑁呭嵆鍙紝瀹夎瀹屾垚鍚庝細鑷姩鍚姩嫻忚鍣ㄥ悜瀵鹼紝鏍規(guī)嵁鎻愮ず鎿嶄綔瀹屾垚瀹夎
鏈満涓嬭澆瀹夎鍖咃紝瀹夎鍒癈:\Jenkins錛屽涓嬮厤緗篃鏄熀浜庢鐩綍榪涜錛屼笅杞藉強瀹夎榪囩▼鎴浘濡備笅

閫夋嫨Download Jenkins

涓嬫媺閫夋嫨鐩稿簲鐨勬搷浣滅郴緇熺増鏈紝涔熷彲浠ョ洿鎺ヤ笅杞絯ar鍖咃紝鏈枃涓嬭澆Windows鐗堟湰鐨勫畨瑁呭寘錛屽畨瑁呰繃紼嬫寚瀹氬畨瑁呯洰褰曞嵆鍙紝瀹夎瀹屾垚鍚庯紝浼氳嚜鍔ㄥ惎鍔ㄦ祻瑙堝櫒榪涜閰嶇疆

鏍規(guī)嵁欏甸潰鎻愮ず錛屽湪鏂囦歡涓壘鍒板瘑鐮佸~鍏?br />
閫夋嫨鎻掍歡錛屾湰渚嬮夋嫨絎簩欏癸紝鑷繁瀹氫箟鎻掍歡錛屾墦寮絎簩欏歸噷鐨勯粯璁ら夋嫨鍜屾帹鑽愭彃浠朵竴鏍鳳紝濡傛灉涓嶅仛淇敼錛屽氨鐩稿綋浜庨夋嫨鎺ㄨ崘鎻掍歡瀹夎

瀹夎瀹屾垚鍚庯紝璁劇疆綆$悊鍛樿處鍙?br />
淇濆瓨緇撴潫瀹夎

鐐瑰嚮寮濮嬭繘鍏enkins鐣岄潰

2.鍚姩Jenkins

Jenkins榛樿宸ヤ綔鐩綍浼氬湪褰撳墠鐢ㄦ埛鐩綍涓嬪垱寤?jenkins鐩綍錛屼篃鍙互閫氳繃璁劇疆鐜鍙橀噺鏉ヤ慨鏀癸紝渚嬪錛?
set JENKINS_HOME=C:\jenkins
鐒跺悗閲嶆柊鍚姩jenkins錛屽彲浠ユ斁鍦ㄤ笌瀹夎鐩綍涓嶅悓鐨勫湴鏂?br /> 榪涘叆瀹夎鐩綍C:\Jenkins錛岀敤鍛戒護琛屾柟寮忓惎鍔?br />
java -jar jenkins.war
榛樿绔彛涓?080錛屽鏋滈渶瑕佹寚瀹氱鍙o紝鍙互浣跨敤濡備笅鍙傛暟鎸囧畾錛屽鎸囧畾绔彛涓?000
java -jar jenkins.war --httpPort=9000
涔熷彲浠ヤ慨鏀圭洰褰曚笅鐨刯enkins.xml閰嶇疆鏂囦歡錛屽皢鍏朵腑鐨刪ttpPort淇敼鍗沖彲
<arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080 --webroot="%BASE%\war"</arguments>

3.閮ㄧ講搴旂敤鍒癑enkins

涔嬪墠鐨勫伐紼嬫槸鍩轟簬Tomcat+Eclipse寮鍙戠殑錛屽伐紼嬩笉鏄敤Maven綆$悊鐨勶紝鍚庨潰灝卞宸ョ▼榪涜浜嗘敼閫狅紝鐢ˋnt緙栬瘧錛屾坊鍔犱簡build.xml鏂囦歡錛屽湪Ant涓渶瑕佹壘鍒癟omcat鐩綍錛屼負浜嗙伒媧諱竴鐐癸紝鍦ㄧ郴緇熼噷娣誨姞浜員omcat鐨勭幆澧冨彉閲廋ATALINA_HOME錛屼互鍙夾nt鐜鐨勫畨瑁咃紝榪欐槸瀵瑰師鏈夊伐紼嬬殑鏀歸狅紝濡傛灉鏂扮殑宸ョ▼閲囩敤Maven鏂瑰紡鐨勮瘽錛屽簲璇ヤ細娌℃湁榪欎箞楹葷儲錛岄檮涓奲uild.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<project basedir="." default="build" name="xi">
    <property environment="env"/>
    <property name="tomcat.home" value="${env.CATALINA_HOME}" />
    <property name="tomcat.lib" value="${env.CATALINA_HOME}/lib" />
    <property name="web.root" value="${env.CATALINA_HOME}/webapps"/>
    <property name="ant.home" value="${env.ANT_HOME}" />
    <property name="debuglevel" value="source,lines,vars"/>
    <property name="target" value="1.7"/>
    <property name="source" value="1.7"/>
    <property name="webRoot.dir" value="${basedir}/WebContent" />
    <property name="src.dir" value="${basedir}/src" />
    <property name="lib.dir" value="${webRoot.dir}/WEB-INF/lib" />  
    <property name="log.file" value="${tomcat.home}/webapps/log.info"/> 

    <tstamp> 
        <format property="build.time" pattern="yyyy-MM-dd HH:mm:ss" /> 
    </tstamp>


    <path id="prj.classpath">
        <pathelement location="build/classes"/>
        <fileset dir="${tomcat.lib}">  
            <include name="*.jar" />  
        </fileset>
        <fileset dir="${lib.dir}">  
            <include name="*.jar" />  
        </fileset>
    </path>
    <path id="tomcat.classpath">
        <fileset dir="${tomcat.lib}">  
            <include name="*.jar" />  
        </fileset>
        <fileset dir="${tomcat.home}/bin">  
            <include name="*.jar" />  
        </fileset>
    </path>

    <target name="init">
        <echo message="---------- init ----------"></echo>
        <mkdir dir="build/classes"/>
        <copy includeemptydirs="false" todir="build/classes">
            <fileset dir="src">
                <exclude name="**/*.java"/>
            </fileset>
        </copy>
    </target>
    
    <target name="clean">
        <echo message="---------- clean ----------"></echo>
        <delete dir="build/classes"/>
        <delete file="build/${ant.project.name}.war"></delete>
    </target>

    <target name="compile" depends="init">
        <echo message="${ant.project.name}: ${ant.file}"/>
        <javac debug="true" debuglevel="${debuglevel}" destdir="build/classes" includeantruntime="false"  encoding="UTF-8">
            <src path="src"/>
            <classpath refid="prj.classpath"/>
        </javac>
        <delete file="build/classes/gen-conf.xml"/>
    </target>

    <target name="build" depends="compile" description="make war">
        <war destfile="build/${ant.project.name}.war" basedir="WebContent" webxml="WebContent/WEB-INF/web.xml">
            <!-- lib dir="${lib.dir}"></lib -->
            <classes dir="${basedir}/build/classes"></classes>
        </war>
    </target>

    <target name="deploy" depends="build" description="deploy to tomcat"> 
        <echo message="----------deploy to tomcat----------"></echo>
        <delete file="${tomcat.home}/webapps/${ant.project.name}.war" /> 
        <delete dir="${tomcat.home}/webapps/${ant.project.name}" /> 
        <copy file="build/${ant.project.name}.war" todir="${tomcat.home}/webapps" /> 
    </target>

    <target name="undeploy" description="deploy to tomcat"> 
        <echo message="---------- undeploy project ----------"></echo>
        <delete file="${tomcat.home}/webapps/${ant.project.name}.war" /> 
        <delete dir="${tomcat.home}/webapps/${ant.project.name}" /> 
    </target> 

    
</project>
榪欐牱鍐欐槸涓轟簡鍦↗enkins閲岃皟鐢ˋnt瀹屾垚緙栬瘧鍜岄儴緗茬殑宸ヤ綔銆?br /> 鍦↗enkins閲屽垱寤洪」鐩紝褰撳墠閫夋嫨鐨勬槸鑷敱欏圭洰錛屽啓濂介」鐩悕縐幫紝鍚庣畫灝辨槸瀵歸」鐩繘琛岄厤緗紝濡傛灉涓嶅笇鏈涗繚鐣欒繃澶氱殑鏃ф瀯寤猴紝鍙互璁劇疆涓㈠純銆傚彟澶栬繕闇瑕佽幏鍙栨簮鐮佺殑鏈嶅姟鍣紝榛樿鏀寔CVS鍜孲ubversion錛屼篃鍙互閫氳繃鎻掍歡鏀寔Git錛屽洜褰撳墠欏圭洰鎵樼浜嶴VN錛岄厤緗涓嬪浘

鍚庨潰鏄浣曡Е鍙戠殑閰嶇疆錛屽涓嬭緗負姣忓ぉ6:30榪涜鏋勫緩錛屾瘡涓涓皬鏃舵鏌ヤ竴涓嬫簮鐮侊紝涓昏鏄幏鍙栧埌浠g爜鍚庣殑鍔ㄤ綔璁劇疆

鍦ㄥ姩浣滆緗噷鐢╓indows鐨勬壒澶勭悊鏂瑰紡榪涜錛屽師鏈冭檻鍦ㄦ湇鍔″櫒涓婂仛涓涓壒澶勭悊錛岀敱Jenkins璋冪敤錛岀粡嫻嬭瘯闇瑕佺敤緇濆璺緞錛屼笉鐭ユ槸涓嶆槸鏌愪釜鍦版柟娌¢厤緗ソ錛屽悗鏉ュ氨鏀圭敤榪欑鏂瑰紡錛屽鏈嶅姟榪涜鍚姩鍋滄鎺у埗錛屽宸ョ▼榪涜閮ㄧ講
緇忔祴璇曪紝姝ゆ柟寮忓彲浠ョ敤錛屽綋鍓嶇敤鏉ヨВ鍐砊omcat+Eclipse鐜涓嬬殑宸ョ▼鑷姩鏋勫緩闂錛屽啓鍦ㄨ繖涓湴鏂瑰仛涓褰曪紝濡傛灉鏈夋満浼氾紝灝濊瘯涓涓婱aven錛岀湅鐪嬫槸涓嶆槸瑕佺畝鍗曠偣

ZhouFeng 2017-01-02 11:51 鍙戣〃璇勮
]]>
jQuery鎵撳嵃鎻掍歡printPagehttp://www.tkk7.com/zhouf/articles/printpage.htmlZhouFengZhouFengTue, 29 Nov 2016 03:53:00 GMThttp://www.tkk7.com/zhouf/articles/printpage.htmlhttp://www.tkk7.com/zhouf/comments/432017.htmlhttp://www.tkk7.com/zhouf/articles/printpage.html#Feedback0http://www.tkk7.com/zhouf/comments/commentRss/432017.htmlhttp://www.tkk7.com/zhouf/services/trackbacks/432017.html闃呰鍏ㄦ枃

ZhouFeng 2016-11-29 11:53 鍙戣〃璇勮
]]>
JSP闈欐佸寲HTML絎旇http://www.tkk7.com/zhouf/articles/383790.htmlZhouFengZhouFengMon, 23 Jul 2012 11:37:00 GMThttp://www.tkk7.com/zhouf/articles/383790.htmlhttp://www.tkk7.com/zhouf/comments/383790.htmlhttp://www.tkk7.com/zhouf/articles/383790.html#Feedback0http://www.tkk7.com/zhouf/comments/commentRss/383790.htmlhttp://www.tkk7.com/zhouf/services/trackbacks/383790.html
鍒涘緩涓涓猄ervlet錛屼富瑕佸唴瀹瑰涓?br />
 1 String url = "";
 2 String name = "";
 3 
 4 Charset charset = Charset.forName("UTF-8");  //璁劇疆鐢熸垚鏂囦歡鐨勫瓧絎﹂泦
 5 ServletContext servletContext = getServletContext();
 6 
 7 String file_name = request.getParameter("file_name");
 8 url = "/" + file_name + ".jsp";    // 浣犺鐢熸垚鐨勯〉闈㈠姩鎬侀〉闈㈡潵婧?/span>
 9 name = servletContext.getRealPath("/")+"\\"+ file_name + ".html";
10 // 榪欐槸鐢熸垚鐨刪tml鏂囦歡鍚?濡俰ndex.html鏂囦歡鍚嶅瓧涓庢簮鏂囦歡鍚嶇浉鍚?/span>
11 
12 RequestDispatcher requestDispatcher = servletContext.getRequestDispatcher(url);
13 
14 final ByteArrayOutputStream outStream = new ByteArrayOutputStream();
15 
16 final ServletOutputStream stream = new ServletOutputStream() {
17     public void write(byte[] data, int offset, int length) {
18         outStream.write(data, offset, length);
19     }
20 
21     public void write(int b) throws IOException {
22         outStream.write(b);
23     }
24 };
25 
26 final PrintWriter printWriter = new PrintWriter(new OutputStreamWriter(outStream,charset));
27 
28 HttpServletResponse rep = new HttpServletResponseWrapper(response) {
29     public ServletOutputStream getOutputStream() {
30         return stream;
31     }
32 
33     public PrintWriter getWriter() {
34         return printWriter;
35     }
36 };
37 requestDispatcher.include(request, rep);
38 printWriter.flush();
39 FileOutputStream fos = new FileOutputStream(name); // 鎶妀sp杈撳嚭鐨勫唴瀹瑰啓鍒癶tml鏂囦歡涓幓
40 outStream.writeTo(fos);
41 fos.close();
42 out.print("<p align=center>OK</p>");
鎴戞槸鎯蟲妸page.jsp榪欎釜鏂囦歡杞崲鎴恜age.html錛屾墍浠ュ彧浼犱簡涓涓弬鏁幫紝濡傛灉鎯蟲妸show.jsp?id=123杞崲鎴?23.html錛岀浉淇¤繖涔熼毦涓嶅埌澶у錛屽彧涓嶈繃寰楁敞鎰忓紩鐢–SS鎴栧浘鐗囩殑璺緞
榪欐槸鍦ㄧ綉涓婇偅浣嶄粊鍏勮創(chuàng)鍑烘潵鐨勪唬鐮侊紝騫跺仛浜嗕簺淇敼錛屼粬榪樹粙緇嶄簡鍏跺畠鐨勪簺錛屽叾瀹冪殑榪樻病鏉ュ緱鍙婂涔狅紝鍏堟妸榪欎簺璁板綍涓嬫潵銆?br />鎴戝湪杞崲鐨勬椂鍊欙紝紕板埌涓枃闂錛屾洿鏀箁equest鍜宺esponse鐨勫瓧絎﹂泦閮芥悶涓嶅畾錛岃繕濂藉弬鑰冧簡http://www.tkk7.com/zphab/articles/295631.html錛屾妸瀛楃緙栫爜鍔犺繃鏉ヤ簡錛屼腑鏂囨墠綆楁悶瀹氫簡錛岀畝鍗曠殑嫻嬭瘯閫氳繃鍚庯紝鏀懼湪搴旂敤閲屽氨濂藉姙浜嗐備漢瀹跺啓鍑烘潵榪欎箞澶氬勾浜嗭紝鎵嶅彂鐜幫紝鎯劎鍛

浠ヤ笂鏂規(guī)鍙傝冿細http://blog.csdn.net/noove_001/article/details/1953682

ZhouFeng 2012-07-23 19:37 鍙戣〃璇勮
]]>
MyBatis浠g爜鐢熸垚宸ュ叿mybatis-generator鐨勪嬌鐢?/title><link>http://www.tkk7.com/zhouf/articles/383720.html</link><dc:creator>ZhouFeng</dc:creator><author>ZhouFeng</author><pubDate>Sun, 22 Jul 2012 09:12:00 GMT</pubDate><guid>http://www.tkk7.com/zhouf/articles/383720.html</guid><wfw:comment>http://www.tkk7.com/zhouf/comments/383720.html</wfw:comment><comments>http://www.tkk7.com/zhouf/articles/383720.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/zhouf/comments/commentRss/383720.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/zhouf/services/trackbacks/383720.html</trackback:ping><description><![CDATA[鍦ㄧ敤MyBatis鐨勬椂鍊欙紝浼氭秹鍙婂埌POJO綾葷殑緙栧啓錛孧apper鎺ュ彛鐨勭紪鍐欙紝榪樻湁涓浜泋ml閰嶇疆鏂囦歡錛屾暟鎹簱鐨勫垱寤轟篃寰楄嚜宸卞畬鎴愶紝榪欐牱鍙槸鎶婃暟鎹簱璁塊棶鏂瑰紡鎹㈡垚浜哋RM鐨勬柟寮忚繘琛岋紝宸ヤ綔閲忓茍娌℃湁鍑忓皯錛屽湪MyBatis涓婚〉閲屾湁鐪嬪埌鎻愪緵鐨勪唬鐮佺敓鎴愬伐鍏鳳紝渚胯瘯浜嗕竴涓嬶紝鍐欏ソ閰嶇疆鏂囦歡鍚庯紝鎵ц涓鏉″懡浠や究鐢熸垚浜嗕箣鍓嶆垜浠墜宸ュ畬鎴愮殑榪欎簺鏂囦歡錛屽緢閰峰搰銆?br />棣栧厛鍦ㄧ綉涓婁笅杞?a >mybatis-generator</a>錛屾澶勪笅杞界殑鏄?.1.1鐨勭増鏈殑涓涓獄ip鍖咃紝涓嬭澆濂藉悗瑙e帇<br />瑙e帇鍚庢湁涓猟oc鐩綍鍜屼竴涓猯ib鐩綍錛宒oc鐩綍鎻愪緵浜嗕竴涓嬌鐢ㄨ鏄庢枃妗o紝lib鐩綍鏄垜浠渶瑕佺殑jar鏂囦歡錛屽綋鐒惰繕鏈夋彁渚涙簮浠g爜鍜屾枃妗ar錛岃繖浜涘彲浠ュ鍏yEclipse閲岀敤<br />榪涘叆鍒發(fā)ib鐩綍涓紙褰撶劧涔熷彲浠ュ湪鍒鍒涘緩涓涓洰褰曪紝鍙笉榪囧湪浣跨敤鏃惰鎸囧畾jar鏂囦歡璺緞錛屾澶勪負浜嗘柟渚跨偣錛屽氨鎶婃枃浠剁敓鎴愬湪榪欎釜鐩綍閲屼簡錛夛紝鍒涘緩涓涓厤緗枃浠訛紝濡俢onf.xml錛屾澶勬枃浠跺悕鑷繁鍛藉悕錛屾病鏈夊懡鍚嶆柟闈㈢殑鐗規(guī)畩瑕佹眰錛屾垜鏄弬鑰僤oc鏂囨。閲岀殑閰嶇疆鏂囦歡鍐欑殑錛屽涓?br /><div style="font-size: 13px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #cccccc; border-right-color: #cccccc; border-bottom-color: #cccccc; border-left-color: #cccccc; padding-right: 5px; padding-bottom: 4px; padding-left: 4px; padding-top: 4px; width: 98%; word-break: break-all; background-color: #eeeeee; "><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; "><?</span><span style="color: #FF00FF; ">xml version="1.0" encoding="UTF-8"</span><span style="color: #0000FF; ">?></span><span style="color: #000000; "><br /></span><span style="color: #0000FF; "><!</span><span style="color: #FF00FF; ">DOCTYPE generatorConfiguration<br />  PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"<br />  "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br /><br /></span><span style="color: #0000FF; "><</span><span style="color: #800000; ">generatorConfiguration</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />  </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">classPathEntry </span><span style="color: #FF0000; ">location</span><span style="color: #0000FF; ">="mysql-connector-java-3.1.13-bin.jar"</span><span style="color: #FF0000; "> </span><span style="color: #0000FF; ">/><br /></span><span style="color: #000000; "><br />  </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">context </span><span style="color: #FF0000; ">id</span><span style="color: #0000FF; ">="mysqlTables"</span><span style="color: #FF0000; "> targetRuntime</span><span style="color: #0000FF; ">="MyBatis3"</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br /><br />    </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">jdbcConnection </span><span style="color: #FF0000; ">driverClass</span><span style="color: #0000FF; ">="com.mysql.jdbc.Driver"</span><span style="color: #FF0000; "><br />        connectionURL</span><span style="color: #0000FF; ">="jdbc:mysql://localhost/bbs"</span><span style="color: #FF0000; "><br />        userId</span><span style="color: #0000FF; ">="root"</span><span style="color: #FF0000; "><br />        password</span><span style="color: #0000FF; ">="1233"</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />    </span><span style="color: #0000FF; "></</span><span style="color: #800000; ">jdbcConnection</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br /><br />    </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">javaTypeResolver </span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />      </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">property </span><span style="color: #FF0000; ">name</span><span style="color: #0000FF; ">="forceBigDecimals"</span><span style="color: #FF0000; "> value</span><span style="color: #0000FF; ">="false"</span><span style="color: #FF0000; "> </span><span style="color: #0000FF; ">/></span><span style="color: #000000; "><br />    </span><span style="color: #0000FF; "></</span><span style="color: #800000; ">javaTypeResolver</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br /><br />    </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">javaModelGenerator </span><span style="color: #FF0000; ">targetPackage</span><span style="color: #0000FF; ">="test.model"</span><span style="color: #FF0000; "> targetProject</span><span style="color: #0000FF; ">="src"</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />      </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">property </span><span style="color: #FF0000; ">name</span><span style="color: #0000FF; ">="enableSubPackages"</span><span style="color: #FF0000; "> value</span><span style="color: #0000FF; ">="true"</span><span style="color: #FF0000; "> </span><span style="color: #0000FF; ">/></span><span style="color: #000000; "><br />      </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">property </span><span style="color: #FF0000; ">name</span><span style="color: #0000FF; ">="trimStrings"</span><span style="color: #FF0000; "> value</span><span style="color: #0000FF; ">="true"</span><span style="color: #FF0000; "> </span><span style="color: #0000FF; ">/></span><span style="color: #000000; "><br />    </span><span style="color: #0000FF; "></</span><span style="color: #800000; ">javaModelGenerator</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br /><br />    </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">sqlMapGenerator </span><span style="color: #FF0000; ">targetPackage</span><span style="color: #0000FF; ">="test.xml"</span><span style="color: #FF0000; ">  targetProject</span><span style="color: #0000FF; ">="src"</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />      </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">property </span><span style="color: #FF0000; ">name</span><span style="color: #0000FF; ">="enableSubPackages"</span><span style="color: #FF0000; "> value</span><span style="color: #0000FF; ">="true"</span><span style="color: #FF0000; "> </span><span style="color: #0000FF; ">/></span><span style="color: #000000; "><br />    </span><span style="color: #0000FF; "></</span><span style="color: #800000; ">sqlMapGenerator</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br /><br />      <br />    </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">javaClientGenerator </span><span style="color: #FF0000; ">type</span><span style="color: #0000FF; ">="XMLMAPPER"</span><span style="color: #FF0000; "> targetPackage</span><span style="color: #0000FF; ">="test.dao"</span><span style="color: #FF0000; ">  targetProject</span><span style="color: #0000FF; ">="src"</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />      </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">property </span><span style="color: #FF0000; ">name</span><span style="color: #0000FF; ">="enableSubPackages"</span><span style="color: #FF0000; "> value</span><span style="color: #0000FF; ">="true"</span><span style="color: #FF0000; "> </span><span style="color: #0000FF; ">/></span><span style="color: #000000; "><br />    </span><span style="color: #0000FF; "></</span><span style="color: #800000; ">javaClientGenerator</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br /><br />    </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">table </span><span style="color: #FF0000; ">tableName</span><span style="color: #0000FF; ">="tb_users"</span><span style="color: #FF0000; "> </span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />    </span><span style="color: #0000FF; "></</span><span style="color: #800000; ">table</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />      <br />  </span><span style="color: #0000FF; "></</span><span style="color: #800000; ">context</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br /></span><span style="color: #0000FF; "></</span><span style="color: #800000; ">generatorConfiguration</span><span style="color: #0000FF; ">></span></div><table>鏍囩閲屾寚瀹氳鐢熸垚鐨勭浉鍏蟲暟鎹〃錛屽鏋滄湁澶氫釜琛ㄧ殑璇濓紝闇瑕侀厤緗涓?lt;table><br />鏁版嵁搴撹繕鏄敤涔嬪墠鍒涘緩濂界殑鏁版嵁搴撳拰琛紝騫舵寚瀹氫簡瑕佺敓鎴愭枃浠剁殑鐩稿叧琛紝鍥犱負瑕佺敤鍒頒笌鏁版嵁搴撶殑榪炴帴錛屽緱鍔犺澆鏁版嵁搴撻┍鍔紝鍙互灝唌ysql鐨勯┍鍔ㄦ斁鍦ㄧ郴緇熺幆澧冨彉閲忕殑classpath閲岋紝涔熷彲浠ュ湪閰嶇疆鏂囦歡閲屾寚瀹氳礬寰勶紝姝ゅ涓轟簡閰嶇疆鏂囦歡鏂逛究錛屾妸mysql鐨勯┍鍔╦ar鍖呮嫹璐濆埌l(fā)ib鐩綍涓嬩簡錛屽茍鍒涘緩涓涓敤浜庡瓨鏀劇敓鎴愭枃浠剁殑src鏂囦歡澶?br />鍦ㄥ懡浠ょ獥鍙fā寮忎笅錛岃繘鍏ュ埌l(fā)ib鐩綍錛屾墽琛屽涓嬪懡浠?br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #000000; ">java -jar mybatis-generator-core-1.3.1.jar -configfile conf.xml -overwrite</span></div><div>鍛戒護鎵ц瀹屾垚鍚庯紝渚垮彲鍦╯rc鐩綍涓嬬湅鍒扮敓鎴愮殑涓浜涙枃浠朵簡錛屽ぇ姒傜湅浜嗕竴涓嬬敓鎴愮殑浠g爜錛岃嚜宸卞啓鐨勮瘽錛岃繕鏄鑺變竴鐐規(guī)椂闂寸殑錛屾湁濂界殑宸ュ叿錛屽彲鐪熸槸鏂逛究鍛錛屼笉榪囧彂鐜頒竴涓棶棰橈紝鐢熸垚鐨勪唬鐮侀噷鐨勫ソ澶氱殑娉ㄩ噴錛屾劅瑙夋敞閲婃瘮鍙敤浠g爜閮藉錛屾垜鏌ヤ簡涓涓嬮厤緗枃浠訛紝鎵懼埌浜嗕竴涓幓鎺夌敓鎴愭敞閲婄殑鍦版柟錛屾妸瀹冨姞鍦ㄤ簡閰嶇疆鏂囦歡閲岋紝澶ф浣嶇疆濡備笅錛屾垜涔嬪墠鏀鵑敊浜嗗湴鏂癸紝灝辨病娉曡繍琛?br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #000000; ">  </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">context </span><span style="color: #FF0000; ">id</span><span style="color: #0000FF; ">="mysqlTables"</span><span style="color: #FF0000; "> targetRuntime</span><span style="color: #0000FF; ">="MyBatis3"</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />  <br />    </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">commentGenerator</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />      </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">property </span><span style="color: #FF0000; ">name</span><span style="color: #0000FF; ">="suppressAllComments"</span><span style="color: #FF0000; "> value</span><span style="color: #0000FF; ">="true"</span><span style="color: #FF0000; "> </span><span style="color: #0000FF; ">/></span><span style="color: #000000; "><br />      </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">property </span><span style="color: #FF0000; ">name</span><span style="color: #0000FF; ">="suppressDate"</span><span style="color: #FF0000; "> value</span><span style="color: #0000FF; ">="true"</span><span style="color: #FF0000; "> </span><span style="color: #0000FF; ">/></span><span style="color: #000000; "><br />    </span><span style="color: #0000FF; "></</span><span style="color: #800000; ">commentGenerator</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />    <br />    </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">jdbcConnection </span><span style="color: #FF0000; ">driverClass</span><span style="color: #0000FF; ">="com.mysql.jdbc.Driver"</span><span style="color: #FF0000; "><br /><img src="http://www.tkk7.com/Images/dot.gif" alt="" /></span></div>榪欐牱鏀逛簡涔嬪悗錛岀敓鎴愮殑浠g爜灝辨病鏈夋敞閲婁簡錛岃繖涓嬫竻鐖戒簡璁稿錛岃嚦浜?lt;commentGenerator>鏍囩鍜岄噷闈㈢殑涓や釜灞炴х殑鍚箟錛宒oc鏂囨。閲屾湁璇︾粏鐨勮鏄庯紝鎴戝氨涓嶈創(chuàng)鍦ㄨ繖閲屼簡錛屽鏋滆鎶婄敓鎴愮殑鏂囦歡鏀懼埌宸ョ▼搴旂敤閲岋紝娉ㄦ剰鏀逛笅鐩稿叧鐨勮礬寰勫強鍖呭悕錛屽簲璇ュ氨鍙互浜嗐?br />鐢ㄤ簡涓涓嬶紝鎰熻榪欎釜涓滀笢寰堜笉閿欙紝紜疄鐪佷簨鍎夸笉灝戯紝涓嶈繃鎴戣繕娌℃湁鍦ㄩ」鐩腑灝濊瘯錛屽啓鍦ㄨ繖閲屼簡鍏?)</div><img src ="http://www.tkk7.com/zhouf/aggbug/383720.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/zhouf/" target="_blank">ZhouFeng</a> 2012-07-22 17:12 <a href="http://www.tkk7.com/zhouf/articles/383720.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍒濊瘯MyBatishttp://www.tkk7.com/zhouf/articles/383711.htmlZhouFengZhouFengSun, 22 Jul 2012 04:48:00 GMThttp://www.tkk7.com/zhouf/articles/383711.htmlhttp://www.tkk7.com/zhouf/comments/383711.htmlhttp://www.tkk7.com/zhouf/articles/383711.html#Feedback0http://www.tkk7.com/zhouf/comments/commentRss/383711.htmlhttp://www.tkk7.com/zhouf/services/trackbacks/383711.html鍦╳ww.mybatis.org涓婂彲浠ユ壘鍒頒笅杞介摼鎺ワ紝鎴戜笅杞界殑鏄痬ybatis-3.1.1榪欎釜鐗堟湰錛屼笅杞戒竴涓獄ip鍖咃紝閲岄潰鍖呭惈鏈変富瑕佺殑搴撴枃浠秏ybatis-3.1.1.jar錛岃繕鏈変竴浜涘紩鐢ㄧ殑jar錛屼竴涓狿DF璇存槑鏂囨。錛岃繖涓鏄庢枃妗f彁渚涚殑鏄疎鏂囩増錛屽彲浠ュ湪緗戜笂鎵懼埌鐩稿簲鐨勪腑鏂囩増錛屼笅杞藉畬鎴愬悗錛屽氨寮濮嬫垜鐨勬搷浣滀簡銆?br />鍦∕yEclipse閲屽垱寤轟簡涓涓猨ava宸ョ▼錛屾湰鏉ユ槸鎵撶畻鍦╓eb涓嬌鐢ㄧ殑錛屾病鏈夊垱寤篧eb宸ョ▼錛屽彧鏄兂璇曚竴涓婱yBatis榪欎笢涓滐紝java宸ョ▼灝卞彲浠ヤ簡銆?br />鍒涘緩鏃跺紩鍏yBatis搴撳拰鏁版嵁搴撻┍鍔ㄥ簱錛屽垱寤轟竴涓┖鐨勫伐紼?br />
鍑嗗濂芥暟鎹簱錛屾澶勭敤MySQL鍋氱粌涔狅紝鍒涘緩涓涓猙bs鏁版嵁搴擄紝鍒涘緩涓涓猼b_users琛紝緇撴瀯濡備笅
+----------+----------+------+-----+---------+-------+
| Field    | Type     | Null | Key | Default | Extra |
+----------+----------+------+-----+---------+-------+
| userid   | int(11)  | NO   | PRI |         |       |
| username | char(20) | NO   |     |         |       |
+----------+----------+------+-----+---------+-------+

鍒涘緩涓涓猆ser綾伙紝涓庢暟鎹〃瀵瑰簲
package com.cuit.prj.domain;

public class User {
    
private int userid;
    
private String userName;
    
    
public User() {
        
super();
    }
    
public User(int userid, String userName) {
        
super();
        
this.userid = userid;
        
this.userName = userName;
    }
    
public int getUserid() {
        
return userid;
    }
    
public void setUserid(int userid) {
        
this.userid = userid;
    }
    
public String getUserName() {
        
return userName;
    }
    
public void setUserName(String userName) {
        
this.userName = userName;
    }
}
鍐嶅垱寤轟竴涓猆serMapper鎺ュ彛錛岄噷闈㈡彁渚涗簡瀵筓ser鐨勭浉鍏蟲搷浣?br />
package com.cuit.prj.presistence;

import com.cuit.prj.domain.User;

public interface UserMapper {
    User selectUser(
int userid);
    
void insertUser(User user);
    
void updateUser(User user);
    
void deleteUser(int userid);
}
鍐嶅垱寤轟竴涓猆serMapper.xml錛屼笌UserMapper.java瀵瑰簲鐨勪竴涓厤緗枃浠訛紝緇忔湰渚嬫祴璇曪紝鍏朵腑鐨刬d瑕佸拰鎺ュ彛涓殑鏂規(guī)硶鍚嶄竴鑷?br />
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"
>
<mapper namespace="com.cuit.prj.presistence.UserMapper">
    
<select id="selectUser" parameterType="int" resultType="com.cuit.prj.domain.User">
        select *
        from tb_users where userid = #{userid}
    
</select>

    
<insert id="insertUser" parameterType="com.cuit.prj.domain.User">
        insert into tb_users(userid,username) values (#{userid},#{userName})
    
</insert>

    
<update id="updateUser" parameterType="com.cuit.prj.domain.User">
        update tb_users set username = #{userName} where userid = #{userid}
    
</update>

    
<delete id="deleteUser" parameterType="int">
        delete from tb_users where userid = #{userid}
    
</delete>
</mapper>
鍦╯rc涓嬮潰鍒涘緩MyBatis閰嶇疆鏂囦歡mybatis-conf.xml錛岄厤緗枃浠跺悕娌℃湁鐗規(guī)畩瑙勫畾錛屽洜涓哄湪鍚庨潰鐨勪唬鐮侀噷闇瑕佹寚瀹氭枃浠跺悕
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd"
>
<configuration>
    
<environments default="development">
        
<environment id="development">
            
<transactionManager type="JDBC" />
            
<dataSource type="POOLED">
                
<property name="driver" value="com.mysql.jdbc.Driver" />
                
<property name="url" value="jdbc:mysql://localhost/bbs" />
                
<property name="username" value="root" />
                
<property name="password" value="1233" />
            
</dataSource>
        
</environment>
    
</environments>
    
<mappers>
        
<mapper resource="com/cuit/prj/presistence/UserMapper.xml" />
    
</mappers>
</configuration>
鍒涘緩涓涓幏鍙栬繛鎺ョ殑SessionFactory鐨勭被
package com.cuit.prj.sessionfactory;

import java.io.IOException;
import java.io.Reader;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;

public class SessionFactory {
    
public static SqlSession getSession(){
        SqlSession session 
= null;
        String resource 
= "mybatis-conf.xml";
        
try {
            Reader reader 
= Resources.getResourceAsReader(resource);
            SqlSessionFactory sqlMapper 
= new SqlSessionFactoryBuilder().build(reader);
            session 
= sqlMapper.openSession();
        } 
catch (IOException e) {
            e.printStackTrace();
        }
        
return session;
    }
}
鍋氬ソ涓婅堪鍑嗗鍚庯紝鍐欎竴涓富鏂規(guī)硶璋冪敤嫻嬭瘯錛屽涓?br />
package com.cuit.prj;

import org.apache.ibatis.session.SqlSession;
import com.cuit.prj.domain.User;
import com.cuit.prj.presistence.UserMapper;
import com.cuit.prj.sessionfactory.SessionFactory;

public class AppTest {
    public static void main(String[] args) {
        System.out.println(
"Hello");
        SqlSession session 
= SessionFactory.getSession();
        
try {
            UserMapper mapper 
= session.getMapper(UserMapper.class);

            User user 
= mapper.selectUser(2);
            System.out.println(user.getUserName());
        } 
finally {
            session.close();
        }
    }
}
鍦ㄦ暟鎹簱涓坊鍔犱袱鏉¤褰曪紝騫舵彁浜?br />
+--------+----------+
| userid | username |
+--------+----------+
| 1      | user1    |
| 2      | user2    |
+--------+----------+
鎺ヤ笅鏉ュ氨鍙互榪愯鐪嬬湅緇撴灉浜嗐傝緭鍑哄涓嬶細
Hello
user2
緇堜簬璺戣搗鏉ヤ簡錛屽湪澶勭悊浜嗕竴緋誨垪鐨凟xception涔嬪悗鐪嬪埌鐨勭粨鏋滐紝涓婇潰鐨勬祴璇曞彧鏄仛浜嗕竴涓鍙栨暟鎹殑鎿嶄綔錛屽鏋滄湁鏂板鎴栦慨鏀規(guī)暟鎹紝闇瑕佽皟鐢╯ession.commit()鎿嶄綔銆?br />澶ф灝忕粨涓涓嬶紝鐢ㄤ簡MyBatis鎰熻榪樻槸寰堜笉閿欑殑錛屾妸SQL璇彞鍜孞AVA浠g爜鍒嗙寮錛屽枩嬈㈣嚜宸辨帉鎺QL璇彞鐨勪漢浠彲鑳戒細鍠滄MyBatis涓浜涳紝涓嶅儚Hibernate閭f牱鍙互瀹屽叏涓嶇敤鍐橲QL璇彞銆傚彧鏄厤緗枃浠跺拰鎺ュ彛鍐欒搗鏉ヨ繕鏄湁浜涢夯鐑︼紝榪樻湁POJO綾葷殑鐢熸垚錛屽伐浣滈噺榪樻槸涓嶅皬鍝囷紝緗戜笂鎵懼埌涓涓敓鎴愬伐鍏鳳紝涓嬫鐮旂┒涓涓嬪啀琛ュ厖涓婃潵銆?/div>

ZhouFeng 2012-07-22 12:48 鍙戣〃璇勮
]]>嫻姩QQ瀹㈡湇鐨勫疄鐜?/title><link>http://www.tkk7.com/zhouf/articles/362729.html</link><dc:creator>ZhouFeng</dc:creator><author>ZhouFeng</author><pubDate>Sat, 05 Nov 2011 02:01:00 GMT</pubDate><guid>http://www.tkk7.com/zhouf/articles/362729.html</guid><wfw:comment>http://www.tkk7.com/zhouf/comments/362729.html</wfw:comment><comments>http://www.tkk7.com/zhouf/articles/362729.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/zhouf/comments/commentRss/362729.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/zhouf/services/trackbacks/362729.html</trackback:ping><description><![CDATA[榪欎釜鍔熻兘鏄渶榪戠殑涓涓笢涓滈渶瑕侊紝鎵浠ュ叧娉ㄤ簡涓涓嬶紝鍦ㄧ綉涓婃壘浜嗕竴浜涳紝鎰熻閮芥湁鐐瑰鏉傦紝緇忚繃涓孌墊椂闂寸殑瀛︿範鍚庯紝緇堜簬瀹炵幇浜嗕竴涓◢寰畝媧佺殑鐗堟湰<br />鎴戞槸鐢ㄧ殑wp.qq.com瀹樻柟緗戠珯涓婄殑鎻愮ず瀹屾垚浜嗭紝鍦ㄩ〉闈㈤噷瀹氫箟涓涓狣IV錛岄噷闈㈢殑鍐呭瀹夋帓灝辮嚜宸辯‘瀹氫簡錛屾垜鐨勪唬鐮佸涓?br /><div style="font-size: 13px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #cccccc; border-right-color: #cccccc; border-bottom-color: #cccccc; border-left-color: #cccccc; padding-right: 5px; padding-bottom: 4px; padding-left: 4px; padding-top: 4px; width: 98%; word-break: break-all; background-color: #eeeeee; "><!--<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; "> 鍦ㄧ嚎瀹㈡湇閮ㄥ垎 </span><span style="color: #008000; ">--></span><span style="color: #000000; "><br />    </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">div </span><span style="color: #FF0000; ">id</span><span style="color: #0000FF; ">="online_box"</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />        </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">div </span><span style="color: #FF0000; ">id</span><span style="color: #0000FF; ">="title"</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />            鑱旂郴鎴戜滑<br />        </span><span style="color: #0000FF; "></</span><span style="color: #800000; ">div</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />        </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">div </span><span style="color: #FF0000; ">id</span><span style="color: #0000FF; ">="qqlist"</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />            </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">p</span><span style="color: #0000FF; ">></span><span style="color: #000000; ">鐢?shù)璇?</span><span style="color: #0000FF; "></</span><span style="color: #800000; ">p</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />            </span><span style="color: #FF0000; ">&nbsp;&nbsp;&nbsp;</span><span style="color: #000000; ">(028)1234567</span><span style="color: #0000FF; "><</span><span style="color: #800000; ">br</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />            </span><span style="color: #FF0000; ">&nbsp;&nbsp;&nbsp;</span><span style="color: #000000; ">(028)1234567</span><span style="color: #0000FF; "><</span><span style="color: #800000; ">br</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />            </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">br</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />            鍦ㄧ嚎鍜ㄨ:<br />            </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">p</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />                瀹㈡湇1銆</span><span style="color: #0000FF; "><</span><span style="color: #800000; ">a </span><span style="color: #FF0000; ">target</span><span style="color: #0000FF; ">="_blank"</span><span style="color: #FF0000; "> href</span><span style="color: #0000FF; ">="http://wpa.qq.com/msgrd?v=3&uin=111111&site=qq&menu=yes"</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />                    </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">img </span><span style="color: #FF0000; ">border</span><span style="color: #0000FF; ">="0"</span><span style="color: #FF0000; "> src</span><span style="color: #0000FF; ">="http://wpa.qq.com/pa?p=2:111111:41"</span><span style="color: #FF0000; "> alt</span><span style="color: #0000FF; ">="鐐瑰嚮榪欓噷緇欐垜鍙戞秷鎭?</span><span style="color: #FF0000; "> title</span><span style="color: #0000FF; ">="鐐瑰嚮榪欓噷緇欐垜鍙戞秷鎭?</span><span style="color: #0000FF; ">></</span><span style="color: #800000; ">a</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />            </span><span style="color: #0000FF; "></</span><span style="color: #800000; ">p</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />            </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">p</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />                瀹㈡湇2銆</span><span style="color: #0000FF; "><</span><span style="color: #800000; ">a </span><span style="color: #FF0000; ">target</span><span style="color: #0000FF; ">="_blank"</span><span style="color: #FF0000; "> href</span><span style="color: #0000FF; ">="http://wpa.qq.com/msgrd?v=3&uin=222222&site=qq&menu=yes"</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />                    </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">img </span><span style="color: #FF0000; ">border</span><span style="color: #0000FF; ">="0"</span><span style="color: #FF0000; "> src</span><span style="color: #0000FF; ">="http://wpa.qq.com/pa?p=2:222222:41"</span><span style="color: #FF0000; "> alt</span><span style="color: #0000FF; ">="鐐瑰嚮榪欓噷緇欐垜鍙戞秷鎭?</span><span style="color: #FF0000; "> title</span><span style="color: #0000FF; ">="鐐瑰嚮榪欓噷緇欐垜鍙戞秷鎭?</span><span style="color: #0000FF; ">></</span><span style="color: #800000; ">a</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />            </span><span style="color: #0000FF; "></</span><span style="color: #800000; ">p</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />            </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">p</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />                瀹㈡湇3銆</span><span style="color: #0000FF; "><</span><span style="color: #800000; ">a </span><span style="color: #FF0000; ">target</span><span style="color: #0000FF; ">="_blank"</span><span style="color: #FF0000; "> href</span><span style="color: #0000FF; ">="http://wpa.qq.com/msgrd?v=3&uin=333333&site=qq&menu=yes"</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />                    </span><span style="color: #0000FF; "><</span><span style="color: #800000; ">img </span><span style="color: #FF0000; ">border</span><span style="color: #0000FF; ">="0"</span><span style="color: #FF0000; "> src</span><span style="color: #0000FF; ">="http://wpa.qq.com/pa?p=2:333333:41"</span><span style="color: #FF0000; "> alt</span><span style="color: #0000FF; ">="鐐瑰嚮榪欓噷緇欐垜鍙戞秷鎭?</span><span style="color: #FF0000; "> title</span><span style="color: #0000FF; ">="鐐瑰嚮榪欓噷緇欐垜鍙戞秷鎭?</span><span style="color: #0000FF; ">></</span><span style="color: #800000; ">a</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />            </span><span style="color: #0000FF; "></</span><span style="color: #800000; ">p</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />            <br />        </span><span style="color: #0000FF; "></</span><span style="color: #800000; ">div</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br />    </span><span style="color: #0000FF; "></</span><span style="color: #800000; ">div</span><span style="color: #0000FF; ">></span><span style="color: #000000; "><br /></span><span style="color: #008000; "><!--</span><span style="color: #008000; "> 鍦ㄧ嚎瀹㈡湇閮ㄥ垎緇撴潫 </span><span style="color: #008000; ">--></span></div>閭i儴鍒?lt;a>...</a>鐨勪唬鐮佹槸鍦╳p.qq.com涓婃嫹璐濈殑錛岀綉绔欎笂榪樻湁寰堝鐨勬牱寮忎緵閫夋嫨錛屼負浜嗛傚簲鏈潵鐨勯〉闈㈡牱寮忥紝榪樺緱瀹氫箟璇ュ眰鐨勬牱寮忥紝紜畾鏄劇ず浣嶇疆絳夛紝浣垮叾鏇磋鑼冧簺錛屾垜鐨勬牱寮忓畾涔夊涓?br /><div style="font-size: 13px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #cccccc; border-right-color: #cccccc; border-bottom-color: #cccccc; border-left-color: #cccccc; padding-right: 5px; padding-bottom: 4px; padding-left: 4px; padding-top: 4px; width: 98%; word-break: break-all; background-color: #eeeeee; "><!--<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; ">*******************鍦ㄧ嚎鏈嶅姟閮ㄥ垎*********************</span><span style="color: #008000; ">*/</span><span style="color: #800000; "><br />#online_box</span><span style="color: #000000; ">{</span><span style="color: #FF0000; "><br />    position</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> absolute</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br />    float</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> right</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br />    left</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> 5px</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br />    top</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> 200px</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br />    z-index</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> 10</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br />    border</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> 1px solid #0168b7</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br />    width</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> 170px</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br />    background-color</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> white</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br />    text-align</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> left</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br /></span><span style="color: #000000; ">}</span><span style="color: #800000; "><br />#online_box #title</span><span style="color: #000000; ">{</span><span style="color: #FF0000; "><br />    background-color</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> #0168b7</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br />    color</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> white</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br />    font-size</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> 12</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br />    font-weight</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> bold</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br />    padding</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> 10px</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br /></span><span style="color: #000000; ">}</span><span style="color: #800000; "><br />#online_box #qqlist</span><span style="color: #000000; ">{</span><span style="color: #FF0000; "><br />    font-size</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> 12</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br />    padding</span><span style="color: #000000; ">:</span><span style="color: #0000FF; "> 20px</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br /></span><span style="color: #000000; ">}</span><span style="color: #800000; "><br />#online_box #qqlist img</span><span style="color: #000000; ">{</span><span style="color: #FF0000; "><br />    vertical-align</span><span style="color: #000000; ">:</span><span style="color: #0000FF; ">middle</span><span style="color: #000000; ">;</span><span style="color: #FF0000; "><br /></span><span style="color: #000000; ">}</span></div>鎺ヤ笅鏉ュ氨鏄欏甸潰婊氬姩鐨勫鐞嗭紝瀹炵幇灞傜殑嫻姩錛屾垜鍊熺敤浜唈Query鏉ュ畬鎴愮殑錛屽簱鐨勫紩鍏ュ氨涓嶅繀鍐嶅啓浜嗭紝涓嬮潰闄勪笂鍐欑殑鑴氭湰<br /><div style="font-size: 13px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #cccccc; border-right-color: #cccccc; border-bottom-color: #cccccc; border-left-color: #cccccc; padding-right: 5px; padding-bottom: 4px; padding-left: 4px; padding-top: 4px; width: 98%; word-break: break-all; background-color: #eeeeee; "><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; "> 1</span> <span style="color: #000000; ">$(document).ready(</span><span style="color: #0000FF; ">function</span><span style="color: #000000; ">(){<br /></span><span style="color: #008080; "> 2</span> <span style="color: #000000; ">    <br /></span><span style="color: #008080; "> 3</span> <span style="color: #000000; ">    </span><span style="color: #0000FF; ">var</span><span style="color: #000000; "> bodyTop </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: #008080; "> 4</span> <span style="color: #000000; ">    </span><span style="color: #0000FF; ">var</span><span style="color: #000000; "> selfHeight </span><span style="color: #000000; ">=</span><span style="color: #000000; "> $(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">#online_box</span><span style="color: #000000; ">"</span><span style="color: #000000; ">).height();<br /></span><span style="color: #008080; "> 5</span> <span style="color: #000000; ">    </span><span style="color: #0000FF; ">if</span><span style="color: #000000; "> (</span><span style="color: #0000FF; ">typeof</span><span style="color: #000000; "> window.pageYOffset </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> 'undefined') {<br /></span><span style="color: #008080; "> 6</span> <span style="color: #000000; ">        bodyTop </span><span style="color: #000000; ">=</span><span style="color: #000000; "> window.pageYOffset;<br /></span><span style="color: #008080; "> 7</span> <span style="color: #000000; ">    } </span><span style="color: #0000FF; ">else</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">if</span><span style="color: #000000; "> (</span><span style="color: #0000FF; ">typeof</span><span style="color: #000000; "> document.compatMode </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> 'undefined' </span><span style="color: #000000; ">&&</span><span style="color: #000000; "> document.compatMode </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> 'BackCompat') {<br /></span><span style="color: #008080; "> 8</span> <span style="color: #000000; ">        bodyTop </span><span style="color: #000000; ">=</span><span style="color: #000000; "> document.documentElement.scrollTop;<br /></span><span style="color: #008080; "> 9</span> <span style="color: #000000; ">    }</span><span style="color: #0000FF; ">else</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">if</span><span style="color: #000000; "> (</span><span style="color: #0000FF; ">typeof</span><span style="color: #000000; "> document.body </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> 'undefined') {<br /></span><span style="color: #008080; ">10</span> <span style="color: #000000; ">        bodyTop </span><span style="color: #000000; ">=</span><span style="color: #000000; "> document.body.scrollTop;<br /></span><span style="color: #008080; ">11</span> <span style="color: #000000; ">    }<br /></span><span style="color: #008080; ">12</span> <span style="color: #000000; ">    $(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">#online_box</span><span style="color: #000000; ">"</span><span style="color: #000000; ">).css(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">top</span><span style="color: #000000; ">"</span><span style="color: #000000; ">, bodyTop</span><span style="color: #000000; ">+</span><span style="color: #000000; ">document.body.clientHeight</span><span style="color: #000000; ">-</span><span style="color: #000000; ">selfHeight</span><span style="color: #000000; ">-</span><span style="color: #000000; ">5</span><span style="color: #000000; ">);    <br /></span><span style="color: #008080; ">13</span> <span style="color: #000000; ">});<br /></span><span style="color: #008080; ">14</span> <span style="color: #000000; "><br /></span><span style="color: #008080; ">15</span> <span style="color: #000000; "><br /></span><span style="color: #008080; ">16</span> <span style="color: #000000; "><br /></span><span style="color: #008080; ">17</span> <span style="color: #000000; ">$(window).scroll(</span><span style="color: #0000FF; ">function</span><span style="color: #000000; ">() {<br /></span><span style="color: #008080; ">18</span> <span style="color: #000000; ">    </span><span style="color: #0000FF; ">var</span><span style="color: #000000; "> bodyTop </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: #008080; ">19</span> <span style="color: #000000; ">    </span><span style="color: #0000FF; ">var</span><span style="color: #000000; "> selfHeight </span><span style="color: #000000; ">=</span><span style="color: #000000; "> $(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">#online_box</span><span style="color: #000000; ">"</span><span style="color: #000000; ">).height();<br /></span><span style="color: #008080; ">20</span> <span style="color: #000000; ">    </span><span style="color: #0000FF; ">if</span><span style="color: #000000; "> (</span><span style="color: #0000FF; ">typeof</span><span style="color: #000000; "> window.pageYOffset </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> 'undefined') {<br /></span><span style="color: #008080; ">21</span> <span style="color: #000000; ">        bodyTop </span><span style="color: #000000; ">=</span><span style="color: #000000; "> window.pageYOffset;<br /></span><span style="color: #008080; ">22</span> <span style="color: #000000; ">    } </span><span style="color: #0000FF; ">else</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">if</span><span style="color: #000000; "> (</span><span style="color: #0000FF; ">typeof</span><span style="color: #000000; "> document.compatMode </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> 'undefined' </span><span style="color: #000000; ">&&</span><span style="color: #000000; "> document.compatMode </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> 'BackCompat') {<br /></span><span style="color: #008080; ">23</span> <span style="color: #000000; ">        bodyTop </span><span style="color: #000000; ">=</span><span style="color: #000000; "> document.documentElement.scrollTop;<br /></span><span style="color: #008080; ">24</span> <span style="color: #000000; ">    }</span><span style="color: #0000FF; ">else</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">if</span><span style="color: #000000; "> (</span><span style="color: #0000FF; ">typeof</span><span style="color: #000000; "> document.body </span><span style="color: #000000; ">!=</span><span style="color: #000000; "> 'undefined') {<br /></span><span style="color: #008080; ">25</span> <span style="color: #000000; ">        bodyTop </span><span style="color: #000000; ">=</span><span style="color: #000000; "> document.body.scrollTop;<br /></span><span style="color: #008080; ">26</span> <span style="color: #000000; ">    }<br /></span><span style="color: #008080; ">27</span> <span style="color: #000000; ">    <br /></span><span style="color: #008080; ">28</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: #008080; ">29</span> <span style="color: #008000; "></span><span style="color: #000000; ">    </span><span style="color: #008000; ">//</span><span style="color: #008000; ">$("#online_box").css("top", 100 + bodyTop);</span><span style="color: #008000; "><br /></span><span style="color: #008080; ">30</span> <span style="color: #008000; "></span><span style="color: #000000; "><br /></span><span style="color: #008080; ">31</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: #008080; ">32</span> <span style="color: #008000; "></span><span style="color: #000000; ">    $(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">#online_box</span><span style="color: #000000; ">"</span><span style="color: #000000; ">).css(</span><span style="color: #000000; ">"</span><span style="color: #000000; ">top</span><span style="color: #000000; ">"</span><span style="color: #000000; ">, bodyTop</span><span style="color: #000000; ">+</span><span style="color: #000000; ">document.body.clientHeight</span><span style="color: #000000; ">-</span><span style="color: #000000; ">selfHeight</span><span style="color: #000000; ">-</span><span style="color: #000000; ">5</span><span style="color: #000000; ">);<br /></span><span style="color: #008080; ">33</span> <span style="color: #000000; ">});</span></div>鎴戦噰鐢ㄩ潬宸︿笅鐨勬柟寮忔樉紺猴紝鐩存帴鍦–SS涓棤娉曠‘瀹氶潬涓嬫樉紺虹殑欏甸潰鏄劇ず楂樺害錛屾墍浠ュ湪ready()閲屽仛浜嗕竴嬈″畾浣嶏紝濡傛灉鏄寜涓婂榻愭柟寮忥紝榪欓儴鍒嗗彲浠ヤ笉鍐欙紝鐩存帴鎶奣OP鍐欏湪CSS閲屽氨琛屼簡錛屼笅闈㈢殑婊氬姩瀹氫綅涔熶細綆鍗曚簺<br />濂藉暒錛屼換鍔″畬鎴愶紝鏀跺伐錛屼粖澶╁懆鍏紝鎶婂墠鍑犲ぉ瀹屾垚鐨勪簨鎯呰褰曚竴涓嬪厛:)<img src ="http://www.tkk7.com/zhouf/aggbug/362729.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/zhouf/" target="_blank">ZhouFeng</a> 2011-11-05 10:01 <a href="http://www.tkk7.com/zhouf/articles/362729.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>灝嗘暟鎹簮鐨勮繛鎺ラ厤緗敼涓轟粠閰嶇疆鏂囦歡璇誨彇http://www.tkk7.com/zhouf/articles/299437.htmlZhouFengZhouFengThu, 22 Oct 2009 16:14:00 GMThttp://www.tkk7.com/zhouf/articles/299437.htmlhttp://www.tkk7.com/zhouf/comments/299437.htmlhttp://www.tkk7.com/zhouf/articles/299437.html#Feedback0http://www.tkk7.com/zhouf/comments/commentRss/299437.htmlhttp://www.tkk7.com/zhouf/services/trackbacks/299437.html
鍦ㄦ,鑰冭檻浜嗗嚑縐嶆柟娉?br /> 鏂規(guī)硶涓:鐢⊿pring妗嗘灦,灝嗘暟鎹繛鎺ラ厤緗啓鍦⊿pring鐨勯厤緗枃浠墮噷,鐢⊿pring鐨勬敞鍏ユ柟寮忕敓鎴愬璞?渚涚▼搴忚皟鐢?br /> 鏂規(guī)硶浜?鑷畾涔変竴涓獂ml鏂囦歡,鍦ㄦ暟鎹繛鎺ュ啓鍦▁ml涓?鍐欎竴涓狫avaBean璇誨彇xml
鏂規(guī)硶涓?鐢≒roperty鏂瑰紡瀹氫箟閰嶇疆閰嶇疆鏂囦歡,鐢↗avaBean鏉ヨ鍙栬緗?br /> 鍥犱負鏄竴涓緢灝忕殑涓滀笢,涓烘涓欏硅屼嬌鐢⊿pring妗嗘灦,浼間箮鏈夌偣嫻垂,鐢▁ml鏉ヤ綔閰嶇疆鏂囦歡,鑷繁鍐欒鍙栨柟娉曟椂涔熶笉綆楃畝鍗?鏈綆鍗曠殑榪樻槸絎笁縐?涔熶笉鎯充負榪欑偣鏀瑰姩鐢ㄥぇ鍒,綆鍗曠殑灝辨槸鏈濂界殑:)

棣栧厛鏂板緩涓涓鍙栭厤緗枃浠剁殑DBConfig.java(鐪佺暐浜嗗寘鍙奼etter,setter鏂規(guī)硶)
/**
 * 榪欐槸涓涓幏鍙栨暟鎹簱閰嶇疆鐨勭被
 * 
@author ZF
 
*/
public class DBConfig {
    
private String url;
    
private String driver;
    
private String userName;
    
private String password;

    
/**
     * 
@param args
     
*/
    
public static void main(String[] args) {
        DBConfig conf 
= new DBConfig();

    }
    
    
/**
     * 鍦ㄦ瀯閫犲嚱鏁伴噷璇誨彇閰嶇疆鏂囦歡
     
*/
    
public DBConfig(){
        Properties prop
= new Properties();
        
try
        {
            
//鐩綍鎸囧埌鏍圭洰褰曠殑涓婄駭,鏄負浜嗗皢閰嶇疆鏂囦歡鏀懼湪WEB-INF鐩綍涓?br />             //濡傛灉鐩存帴鏀懼湪鏍圭洰褰曚笅,鍒欓渶灝嗛厤緗枃浠舵斁鍦╟lasses鐩綍涓?/span>
            InputStream is = getClass().getResourceAsStream("/../dbconfig.property");
            prop.load(is);
            
if(is!=null){
                is.close();
            }
        }
        
catch(Exception e) {
            e.printStackTrace();
        }

        
this.setDriver(prop.getProperty("Driver"));
        
this.setUrl(prop.getProperty("URL"));
        
this.setUserName(prop.getProperty("user"));
        
this.setPassword(prop.getProperty("password"));
    }


   
// getters()... and  setters()...
      
}

鐒跺悗鍦╓EB-INF鐩綍涓嬫柊寤洪厤緗枃浠禿bconfig.property
Driver=com.mysql.jdbc.Driver
URL
=jdbc:mysql://localhost/tsoa
user
=mysqluser
password
=mysqlpassword
淇敼鑾峰彇鏁版嵁榪炴帴鐨勪唬鐮?br />
//鑾峰彇鏁版嵁搴撹繛鎺ラ厤緗?/span>
DBConfig dbconf = new DBConfig();

//鏍規(guī)嵁榪炴帴閰嶇疆鑾峰彇鏁版嵁搴撹繛鎺?/span>
Class.forName(dbconf.getDriver()).newInstance();
conn
= DriverManager.getConnection(dbconf.getUrl(),dbconf.getUserName(),dbconf.getPassword());
嫻嬭瘯閫氳繃,OK,鍦ㄦ璁板綍涓涓?br />


ZhouFeng 2009-10-23 00:14 鍙戣〃璇勮
]]>
J2EE瀹氭椂閲囬泦紼嬪簭http://www.tkk7.com/zhouf/articles/263933.htmlZhouFengZhouFengWed, 08 Apr 2009 01:44:00 GMThttp://www.tkk7.com/zhouf/articles/263933.htmlhttp://www.tkk7.com/zhouf/comments/263933.htmlhttp://www.tkk7.com/zhouf/articles/263933.html#Feedback0http://www.tkk7.com/zhouf/comments/commentRss/263933.htmlhttp://www.tkk7.com/zhouf/services/trackbacks/263933.html 棣栧厛錛岀紪鍐欎竴涓猄ervlet鐢ㄤ簬鍚姩瀹氭椂鍣ㄥ拰榪涜浠誨姟璋冨害錛屽弬鑰冧唬鐮佸涓嬶細
import javax.servlet.ServletContextEvent;

public class MyTimer extends javax.servlet.http.HttpServlet implements
        javax.servlet.ServletContextListener {
    
// private static final long serialVersionUID = 1L;

    
private java.util.Timer timer = null;

    
public void contextInitialized(ServletContextEvent event) {
        timer 
= new java.util.Timer(true);
        System.out.println(
"瀹氭椂鍣ㄥ凡鍚姩");
        timer.schedule(
new MyTimerTask(), 024 * 60 * 60 * 1000);
        System.out.println(
"宸茬粡娣誨姞浠誨姟璋冨害琛?/span>");
    }

    
public void contextDestroyed(ServletContextEvent event) {
        timer.cancel();
        System.out.println(
"瀹氭椂鍣ㄩ攢姣?/span>");
    }
}
鍏朵腑鍒╃敤浜嗗畾鏃跺櫒鐨刯ava.util.Timer.schedule(TimerTask task, long delay, long period)鏂規(guī)硶錛岄噷闈㈢殑鍙傛暟渚濇涓猴細浠誨姟綾?寤舵椂錛堝崟浣嶆縐掞級,鍛ㄦ湡錛堝崟浣嶆縐掞級銆傛牴鎹垜鐨勮瀹氾紝姣忥紥錛斿皬鏃惰繍琛屼竴嬈°?br /> 鐒跺悗鏄換鍔¤皟搴︾被錛?br />
import java.util.Calendar;
import java.util.TimerTask;

public class MyTimerTask extends TimerTask {
    
private static final int C_SCHEDULE_HOUR = 22;
    
private static boolean isRunning = false;

    @Override
    
public void run() {
        Calendar cal 
= Calendar.getInstance();
        
if (!isRunning) {
            
if (C_SCHEDULE_HOUR < cal.get(Calendar.HOUR_OF_DAY)) {
                isRunning 
= true;
                System.out.println(
"寮濮嬫墽琛屾寚瀹氫換鍔?/span>");

                
/* Your Code */

                isRunning 
= false;
                System.out.println(
"鎸囧畾浠誨姟鎵ц緇撴潫");
            }
        } 
else {
            System.out.println(
"涓婁竴嬈′換鍔℃墽琛岃繕鏈粨鏉?/span>");
        }
    }
}
鍏朵腑C_SCHEDULE_HOUR涓烘墽琛屼換鍔$殑鏃舵錛屾牴鎹垜鐨勮姹傛槸姣忓ぉ錛掞紥鐐瑰悗鎵嶆墽琛屾垜鐨勯噰闆嗙▼搴忋?br /> 鏈鍚庢槸閰嶇疆渚﹀惉鍣細
鍦╳eb.xml涓坊鍔犱互涓嬩唬鐮侊紝褰撶劧Servlet鍚嶈鎹㈡垚鐪熷疄鐨?br />
<listener>
    
<listener-class>com.test.MyTimer</listener-class>
</listener>
灝辮繖鏍鳳紝鍙渶涓夋錛屼竴涓畝鍗曠殑瀹氭椂閲囬泦榪涚▼灝辨悶瀹氫簡

ZhouFeng 2009-04-08 09:44 鍙戣〃璇勮
]]>
eWebEditor鍦↗BOSS涓嬫棤娉曟樉紺虹殑闂http://www.tkk7.com/zhouf/articles/264392.htmlZhouFengZhouFengWed, 08 Apr 2009 01:40:00 GMThttp://www.tkk7.com/zhouf/articles/264392.htmlhttp://www.tkk7.com/zhouf/comments/264392.htmlhttp://www.tkk7.com/zhouf/articles/264392.html#Feedback0http://www.tkk7.com/zhouf/comments/commentRss/264392.htmlhttp://www.tkk7.com/zhouf/services/trackbacks/264392.html
Exception in JSP: /eWebEditor.jsp:54
緇忚繃涓鐣姌鑵懼悗鍙堝彂鐜頒簡濡備笅鐨勫嚭閿欐彁紺?br />
java.lang.NoClassDefFoundError: org/dom4j/xpath/DefaultXPath
鍚庢潵鍙戠幇鏄痙om4j.jar鐗堟湰涓嶅閫犳垚鐨勯棶棰?JBOSS鑷甫鐨勭増鏈細鍑虹幇涓婅堪鐨勬儏鍐?br /> 瑙e喅鏂規(guī)硶濡備笅:
灝唀WebEditor閲岃嚜甯︾殑dom4j.jar(476K)鐨勬枃浠惰鐩栨帀jboss4\lib\dom4j.jar(297K)鍗沖彲,鏈枃鍙傝冧互涓嬬殑鏉愭枡

The error "java.lang.NoClassDefFoundError: org/dom4j/xpath/DefaultXPath" underlines important changes to the dom4j XML library. It usually happens when you try to call this library's methods in runtime. Older versions that shipped with JBoss used to include Jaxen, but for whatever reason, it is no longer included. Users must download dom4j.jar (now at version 1.6.1) and then jaxen-full.jar (FCS-1.0). Now how to resolve this problem is tricky:

   1. Put dom4j-1.3.jar in {jboss}/lib. This version is known good.
   2. Put dom4j-1.6.1.jar and jaxen-full.jar in {jboss}/server/default/lib. Remove the old dom4j JARs that may exist in that directory.

The reason the newer version cannot be used with JBoss is unknown, but it does not work. The older version is used when reading JBoss-specific config files. The newer version of dom4j kicks in when the default server is initialized. This allows development of applications using newer versions of the XML API.

http://prideafrica.blogspot.com/2006/05/javalangnoclassdeffounderror.html



ZhouFeng 2009-04-08 09:40 鍙戣〃璇勮
]]>
UrlRewrite鐨勪嬌鐢ㄨ褰?/title><link>http://www.tkk7.com/zhouf/articles/251531.html</link><dc:creator>ZhouFeng</dc:creator><author>ZhouFeng</author><pubDate>Fri, 16 Jan 2009 01:50:00 GMT</pubDate><guid>http://www.tkk7.com/zhouf/articles/251531.html</guid><wfw:comment>http://www.tkk7.com/zhouf/comments/251531.html</wfw:comment><comments>http://www.tkk7.com/zhouf/articles/251531.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/zhouf/comments/commentRss/251531.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/zhouf/services/trackbacks/251531.html</trackback:ping><description><![CDATA[涓轟簡涓嶅湪鍦板潃鏍忛噷鏆撮湶榪囧鐨勪俊鎭?鎯沖埌浜嗗仛涓涓湴鍧鐨勯殣钘?鍦ㄧ綉涓婃壘浜嗕竴浜涜祫鏂?鍐沖畾璇曡瘯UrlRewriet<br /> 鍦ㄧ綉涓婁笅杞戒簡<a >urlrewrite</a>鐨勫寘,鎴戜笅杞界殑鏄痷rlrewritefilter-2.6-src.zip<br /> 鎵撳紑鍘嬬緝鍖?灝嗛噷闈㈢殑urlrewrite-2.6.0.jar鏀懼湪宸ョ▼鐨?WEB-INF/lib/鐩綍涓?br /> 灝嗛噷闈㈢殑urlrewrite.xml鏀懼湪宸ョ▼鐨?WEB-INF/鐩綍涓?br /> 淇敼/WEB-INF/web.xml,鍔犲叆榪囨護鍣?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);"><</span><span style="color: rgb(128, 0, 0);">filter</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">filter-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">UrlRewriteFilter</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">filter-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">filter-class</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">filter-class</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">init-param</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">param-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">logLevel</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">param-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />         </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">param-value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">WARN</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">param-value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">init-param</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">filter</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">filter-mapping</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">filter-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">UrlRewriteFilter</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">filter-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">url-pattern</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">/*</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">url-pattern</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">filter-mapping</span><span style="color: rgb(0, 0, 255);">></span></div> 鍦╱rlrewrite.xml閲屽姞鍏ヨ鍒?濡?<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);"><</span><span style="color: rgb(128, 0, 0);">rule</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">note</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />         The rule means that requests to /page/pagea.html will be redirected to /pagea.jsp<br />     </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">note</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">from</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">/html/([a-z]+).html</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">from</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">to</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">/$1.jsp</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">to</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">rule</span><span style="color: rgb(0, 0, 255);">></span></div> 姝ゆ椂鍦ㄦ祻瑙堝櫒閲岃闂?html/pagea.html浼氭樉紺?pagea.jsp鐨勫唴瀹?OK,鎼炲畾<br /> 濡傛灉榪欑鍦板潃闅愯棌鍙,閭d箞鍙互鎶妀sp欏甸潰浼鎴恆sp鎴栨槸php欏甸潰,鏀瑰啓瑙勫垯濡備笅<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, 255);"><</span><span style="color: rgb(128, 0, 0);">rule</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">note</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />         The rule means that requests to /html/pagea.html will be redirected to /pagea.jsp<br />     </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">note</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">from</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">/html/([a-z]+).html</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">from</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">to</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">/$1.jsp</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">to</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">rule</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <br /> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">rule</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">note</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />         The rule means that requests to /asp/pagea.asp will be redirected to /pagea.jsp<br />     </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">note</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">from</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">/asp/([a-z]+).asp</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">from</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">to</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">/$1.jsp</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">to</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">rule</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <br /> </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">rule</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">note</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />         The rule means that requests to /php/pagea.php will be redirected to /pagea.jsp<br />     </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">note</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">from</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">/php/([a-z]+).php</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">from</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br />     </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">to</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">/$1.jsp</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">to</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">rule</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> </span></div> 姝ゆ椂,鍦ㄦ祻瑙堝櫒閲岃緭鍏?br /> /html/pagea.html<br /> /asp/pagea.asp<br /> /php/pagea.php<br /> 鍧囧彲浠ヨ闂〉闈agea.jsp<br /> 鍑犱釜鏈堝墠鎴戝啓浜嗕竴綃囩瑪璁板仛鍦板潃浼鐨?鐪嬫潵瀹屽叏鍙互鐢ㄨ繖涓笢涓滀唬鏇夸簡,涓婃鍐欑殑閭d釜榪樻湁涓浜涢棶棰樻病鏈夊畬鍏ㄨВ鍐?鐢╱rlrewrite鍋氬湴鍧闅愯棌,鐪熸槸鎰熻寰堜笓涓?瀹岀編鍛,鍒濇浣跨敤,鍙兘鏈変簺楂樼駭鐨勫姛鑳借繕娌℃湁鐢ㄥ埌,涓嶈繃閫氳繃榪欐牱鐨勮瘯楠?宸叉劅瑙夊嚭瀹冪殑寮哄ぇ,榪欏簲璇ユ槸涓涓緢濂界殑瑙e喅鏂規(guī).<br /> <br /> <img src ="http://www.tkk7.com/zhouf/aggbug/251531.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/zhouf/" target="_blank">ZhouFeng</a> 2009-01-16 09:50 <a href="http://www.tkk7.com/zhouf/articles/251531.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>HTML琛ㄦ牸鏂戦┈綰?/title><link>http://www.tkk7.com/zhouf/articles/238196.html</link><dc:creator>ZhouFeng</dc:creator><author>ZhouFeng</author><pubDate>Sun, 02 Nov 2008 09:39:00 GMT</pubDate><guid>http://www.tkk7.com/zhouf/articles/238196.html</guid><wfw:comment>http://www.tkk7.com/zhouf/comments/238196.html</wfw:comment><comments>http://www.tkk7.com/zhouf/articles/238196.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/zhouf/comments/commentRss/238196.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/zhouf/services/trackbacks/238196.html</trackback:ping><description><![CDATA[<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br /> <br /> Code highlighting produced by Actipro CodeHighlighter (freeware)<br /> http://www.CodeHighlighter.com/<br /> <br /> --><span style="color: #000000;">/*琛ㄦ牸闂撮殧琛屽彉鑳屾櫙鑹?/<br /> .row<br /> {<br />  alternateColor:expression(bgColor=rowIndex%2==0?'#FFFFFF':'#EFF7FF');<br />  }           <br /> <br />  <br /> 灝嗕笂闈㈢殑浠g爜鍔犲叆鍒皌r涓?br /> <br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">table</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />  </span><span style="color: #0000ff;"><</span><span style="color: #800000;">thead</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />   </span><span style="color: #0000ff;"><</span><span style="color: #800000;">tr</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />    </span><span style="color: #0000ff;"><</span><span style="color: #800000;">td </span><span style="color: #ff0000;">nowrap</span><span style="color: #0000ff;">></span><span style="color: #000000;">鐘舵?/span><span style="color: #0000ff;"></</span><span style="color: #800000;">td</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> <br />   </span><span style="color: #0000ff;"></</span><span style="color: #800000;">tr</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />  </span><span style="color: #0000ff;"></</span><span style="color: #800000;">thead</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />  </span><span style="color: #0000ff;"><</span><span style="color: #800000;">tbody</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />   </span><span style="color: #0000ff;"><</span><span style="color: #800000;">tr </span><span style="color: #ff0000;">class</span><span style="color: #0000ff;">="row"</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />    </span><span style="color: #0000ff;"><</span><span style="color: #800000;">td </span><span style="color: #ff0000;">nowrap</span><span style="color: #0000ff;">></span><span style="color: #000000;">11111</span><span style="color: #0000ff;"></</span><span style="color: #800000;">td</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />   </span><span style="color: #0000ff;"></</span><span style="color: #800000;">tr</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br />  </span><span style="color: #0000ff;"></</span><span style="color: #800000;">tbody</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"></</span><span style="color: #800000;">table</span><span style="color: #0000ff;">></span></div> <img src ="http://www.tkk7.com/zhouf/aggbug/238196.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/zhouf/" target="_blank">ZhouFeng</a> 2008-11-02 17:39 <a href="http://www.tkk7.com/zhouf/articles/238196.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍦═OMCAT涓吉瑁呴〉闈㈠悗緙鍚?/title><link>http://www.tkk7.com/zhouf/articles/230810.html</link><dc:creator>ZhouFeng</dc:creator><author>ZhouFeng</author><pubDate>Wed, 24 Sep 2008 01:40:00 GMT</pubDate><guid>http://www.tkk7.com/zhouf/articles/230810.html</guid><wfw:comment>http://www.tkk7.com/zhouf/comments/230810.html</wfw:comment><comments>http://www.tkk7.com/zhouf/articles/230810.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/zhouf/comments/commentRss/230810.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/zhouf/services/trackbacks/230810.html</trackback:ping><description><![CDATA[涓鐩翠互鏉?鎯沖仛涓涓笢瑗?灝辨槸鍦ㄥ彂甯僇SP宸ョ▼鐨勬椂鍊?涓嶈浜哄鐭ラ亾鏄敤JSP鎶鏈潵鍋氱殑,鏇炬兂鍒扮敤榪囨護鍣?鍙悶浜嗗崐澶?榪樻槸娌℃湁緇撴灉,鍚庢潵鍦ㄩ厤緗枃浠墮噷鍘繪壘鎵?鐪嬬湅鏈夋病鏈変粈涔堝彲浠ュ弬鑰冪殑涓滀笢,緇堜簬璁╂垜緇欐壘鐫浜?鍦╓EB.XML涓彂鐜版湁榪欐牱鐨勭墖孌?鎵懼埌涓嬫墜鐨勫湴鏂逛簡<br /> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">servlet</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">servlet-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">jsp</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">servlet-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">servlet-class</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">org.apache.jasper.servlet.JspServlet</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">servlet-class</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">init-param</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">param-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">fork</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">param-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">param-value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">false</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">param-value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">init-param</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">init-param</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">param-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">xpoweredBy</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">param-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />            </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">param-value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">false</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">param-value</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">init-param</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">load-on-startup</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">3</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">load-on-startup</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">servlet</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><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" />    <br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: rgb(0, 128, 0);"><!--</span><span style="color: rgb(0, 128, 0);"> The mapping for the JSP servlet </span><span style="color: rgb(0, 128, 0);">--></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">servlet-mapping</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">servlet-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">jsp</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">servlet-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">url-pattern</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">*.jsp</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">url-pattern</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">servlet-mapping</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><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: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">servlet-mapping</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">servlet-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">jsp</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">servlet-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">url-pattern</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">*.jspx</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">url-pattern</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">servlet-mapping</span><span style="color: rgb(0, 0, 255);">></span></div> 浜庢槸涔?灝卞啋鍑轟釜鎯蟲硶,娣誨姞涓涓?lt;servlet-mapping>璇曡瘯,鐗囨濡備笅<br /> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: rgb(0, 0, 0);">    </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">servlet-mapping</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">servlet-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">jsp</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">servlet-name</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />        </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">url-pattern</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">*.asp</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">url-pattern</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">servlet-mapping</span><span style="color: rgb(0, 0, 255);">></span></div> <p>鎴戝湪姝ゆ坊鍔犱簡涓涓狝SP鐨勬槧灝?浣犺繕鍙互淇敼涓篜HP鎴栧叾瀹冪殑鍚庣紑,鍐欎簡涓涓祴璇曢〉闈est1.asp濡備笅</p> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img id="Codehighlighter1_2_65_Open_Image" onclick="this.style.display='none'; Codehighlighter1_2_65_Open_Text.style.display='none'; Codehighlighter1_2_65_Closed_Image.style.display='inline'; Codehighlighter1_2_65_Closed_Text.style.display='inline';" alt="" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_2_65_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_2_65_Closed_Text.style.display='none'; Codehighlighter1_2_65_Open_Image.style.display='inline'; Codehighlighter1_2_65_Open_Text.style.display='inline';" alt="" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 0);"><%</span><span id="Codehighlighter1_2_65_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img alt="" src="http://www.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_2_65_Open_Text"><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">@ page language</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">"</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">java</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">"</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> import</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">"</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">java.util.*</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">"</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> pageEncoding</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">"</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">UTF-8</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">"</span></span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 0);">%></span><span style="color: rgb(0, 0, 0);"><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: rgb(0, 0, 255);"><!</span><span style="color: rgb(255, 0, 255);">DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">html</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />  </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">head</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">title</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">utf-8</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">title</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />  </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">head</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><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: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">body</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">h1</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">This is my test page</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">h1</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">h1</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">瀛楃闆嗘槸UTF-8</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">h1</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />  </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">body</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">html</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span></div> <p>鍙〉闈㈡樉紺虹殑鎯呭喌濡備笅</p> <p><img alt="" src="http://www.tkk7.com/images/blogjava_net/zhouf/bbb.JPG" border="0" height="116" width="293" /></p> <p>涓枃鐨勬樉紺烘湁鐐歸棶棰?鍦ㄧ浉鍚岀殑JSP鏂囦歡閲屾病鏈夎繖縐嶆儏鍐靛彂鐢?榪欎釜闂鐩墠榪樹笉娓呮鏄庝箞鍥炰簨</p> <p>浜庢槸閲嶆柊寤轟簡涓涓枃浠秚est2.asp,鐒跺悗鎶婇〉闈㈢紪鐮佹敼鎴怚SO-8859-1鍚庡啀璇?/p> <div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; font-size: 13px; width: 98%; background-color: rgb(238, 238, 238);"><img id="Codehighlighter1_2_70_Open_Image" onclick="this.style.display='none'; Codehighlighter1_2_70_Open_Text.style.display='none'; Codehighlighter1_2_70_Closed_Image.style.display='inline'; Codehighlighter1_2_70_Closed_Text.style.display='inline';" alt="" src="http://www.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_2_70_Closed_Image" style="display: none;" onclick="this.style.display='none'; Codehighlighter1_2_70_Closed_Text.style.display='none'; Codehighlighter1_2_70_Open_Image.style.display='inline'; Codehighlighter1_2_70_Open_Text.style.display='inline';" alt="" src="http://www.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 0);"><%</span><span id="Codehighlighter1_2_70_Closed_Text" style="border: 1px solid rgb(128, 128, 128); display: none; background-color: rgb(255, 255, 255);"><img alt="" src="http://www.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_2_70_Open_Text"><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">@ page language</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">"</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">java</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">"</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> import</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">"</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">java.util.*</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">"</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);"> pageEncoding</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">=</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">"</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">ISO-8859-1</span><span style="color: rgb(0, 0, 0); background-color: rgb(245, 245, 245);">"</span></span><span style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 0);">%></span><span style="color: rgb(0, 0, 0);"><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: rgb(0, 0, 255);"><!</span><span style="color: rgb(255, 0, 255);">DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">html</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />  </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">head</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">title</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">ISO-8859-1</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">title</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />  </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">head</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><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: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">body</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    This is my JSP page. </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">br</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">h1</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">瀛楃闆嗘槸ISO-8859-1</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">h1</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" />  </span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">body</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);"><br /> <img alt="" src="http://www.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">html</span><span style="color: rgb(0, 0, 255);">></span></div> <p>欏甸潰鐨勪腑鏂囪繕鏄棤娉曟甯告樉紺?/p> <p><img alt="" src="http://www.tkk7.com/images/blogjava_net/zhouf/aaa.JPG" border="0" height="87" width="334" /></p> <p>鍙繖鏃跺彲浠ラ氳繃淇敼嫻忚鍣ㄧ殑欏甸潰緙栫爜鏉ユ樉紺烘紜殑涓枃,灝嗛〉闈㈢紪鐮佹敼鎴?綆浣撲腑鏂?GB2312) 鍚庢樉紺哄涓?/p> <p><img alt="" src="http://www.tkk7.com/images/blogjava_net/zhouf/ccc.JPG" border="0" height="98" width="340" /></p> <p>緇堜簬OK浜?鑰屾祻瑙堝櫒閲屾樉紺虹殑鏄闂竴涓猘sp鐨勬枃浠?鍙腑鏂囩殑瀛楃澶勭悊浠嶆劅瑙夋湁浜涗笉瀹岀編,褰撻〉闈㈢紪鐮佹槸UTF-8鐨勬椂鍊?涓嶇鎬庝箞淇敼嫻忚鍣ㄧ殑欏甸潰緙栫爜,涓枃閮芥棤娉曟紜樉紺?濡傛灉鏌愬厔鏈夋洿濂界殑鏂規(guī)硶瑙e喅榪欎釜闂,甯屾湜鐣欎笅涓鐐瑰緩璁?璋㈣阿</p> <p>鏈緥鏄湪Tomcat6涓嬪仛鐨勬祴璇?/p> <img src ="http://www.tkk7.com/zhouf/aggbug/230810.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/zhouf/" target="_blank">ZhouFeng</a> 2008-09-24 09:40 <a href="http://www.tkk7.com/zhouf/articles/230810.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>浠庢祻瑙堝櫒閲屾彁鍙栬璦璁劇疆淇℃伅http://www.tkk7.com/zhouf/articles/227888.htmlZhouFengZhouFengTue, 09 Sep 2008 03:06:00 GMThttp://www.tkk7.com/zhouf/articles/227888.htmlhttp://www.tkk7.com/zhouf/comments/227888.htmlhttp://www.tkk7.com/zhouf/articles/227888.html#Feedback0http://www.tkk7.com/zhouf/comments/commentRss/227888.htmlhttp://www.tkk7.com/zhouf/services/trackbacks/227888.html榪欎袱澶╁湪鎯充竴涓笢涓?灝辨槸鍦↖18N,鍦ㄨ冭檻濡備綍鑾峰彇瀹㈡埛绔殑璇█璁劇疆,鍚庢潵鍦↗STL鐨別xample閲屾壘鍒頒竴鐐逛俊鎭?鎴戜滑鍙互閫氳繃ServletRequest.getLocales()鏂規(guī)硶鑾峰緱涓涓狶ocal瀵硅薄,鍐嶄粠Local瀵硅薄閲屾彁鍙栦俊鎭?涓轟簡鍋氳繖涓祴璇?鎴戣繕鍦ㄦ垜鐨勬祻瑙堝櫒璁劇疆閲屽鍔犱簡鍑犱釜璇█,濡備笅鍥炬墍紺?/p>

璇█棣栭夐」

鐒跺悗鍐欎簡涓涓祴璇曠殑JSP欏甸潰

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  
<head>
    
<title>Local Test</title>
  
</head>
  
  
<body>
    
<% 
      Enumeration enum_ 
= request.getLocales();
      
while (enum_.hasMoreElements()) {
        Locale locale 
= (Locale)enum_.nextElement();
        out.println(
"locale.getDisplayCountry():"+locale.getDisplayCountry()+"<br>");
        out.println(
"locale.getDisplayName():"+locale.getDisplayName()+"<br>");
        out.println(
"locale.getCountry():"+locale.getCountry()+"<br>");
        out.println(
"locale.toString():"+locale.toString()+"<br>");
        out.println(
"<hr>");
      }
    
%>

  
</body>
</html>

Local瀵硅薄榪樻湁寰堝鏂規(guī)硶鍙互璋冪敤,鍦ㄦ鎴戝彧璇曚簡鍑犱釜,榪愯鍚庡湪嫻忚鍣ㄩ噷寰楀埌鐨勭粨鏋滃涓?/p>

locale.getDisplayCountry():涓浗
locale.getDisplayName():涓枃 (涓浗)
locale.getCountry():CN
locale.toString():zh_CN

--------------------------------------------------------------------------------
locale.getDisplayCountry():
locale.getDisplayName():鑻辨枃
locale.getCountry():
locale.toString():en

--------------------------------------------------------------------------------
locale.getDisplayCountry():棣欐腐
locale.getDisplayName():涓枃 (棣欐腐)
locale.getCountry():HK
locale.toString():zh_HK

鑾峰彇浜嗚繖鏍風殑淇℃伅鍚?鍦↗SP欏甸潰閲屾寜鐓ф祻瑙堝櫒璇█璁劇疆鏉ヨ繘琛岄〉闈㈣煩杞簲璇ユ湁鍔炴硶浜?/p>

鍦ㄧ湅JSTL鐨別xample鏃?閲岄潰涔熸湁瀵筰18N鐨勬敮鎸?涓嶈繃榪樻病鏈夋潵寰楀強瀛︿範,涔熻榪樻湁鏇村ソ鐨勫鐞嗗姙娉?灝卞儚STRUTS閲岀殑i18N澶勭悊

浠婂ぉ涔熸葷畻鎼炰簡鐐逛笢瑗垮嚭鏉?鍙堝鍒頒竴鐐圭偣,Good Good Study, Day Day Up



ZhouFeng 2008-09-09 11:06 鍙戣〃璇勮
]]>
鍦↗BOSS涓嬌鐢↗STLhttp://www.tkk7.com/zhouf/articles/227827.htmlZhouFengZhouFengMon, 08 Sep 2008 15:10:00 GMThttp://www.tkk7.com/zhouf/articles/227827.htmlhttp://www.tkk7.com/zhouf/comments/227827.htmlhttp://www.tkk7.com/zhouf/articles/227827.html#Feedback0http://www.tkk7.com/zhouf/comments/commentRss/227827.htmlhttp://www.tkk7.com/zhouf/services/trackbacks/227827.html 棣栧厛鍦ˋPACHE緗戠珯涓婂彲浠ヤ笅杞絁STL(鎴戜笅杞界殑鏄?a >jakarta-taglibs-standard-1.1.2.zip),鍙兘鍚庨潰鐨勭増鏈細鏈夌偣鍙樺寲
瑙e帇ZIP鏂囦歡,灝嗛噷闈㈢殑standard.jar鍜宩stl.jar鏂囦歡鏀懼湪宸ョ▼涓殑/WEB-INF/lib鐩綍涓?br /> 鍦?WEB-INF鐩綍涓嬪緩涓涓柊鐨勬枃浠跺すtld
灝唞ip鏂囦歡閲岀殑*.tld鏂囦歡瑙e帇鏀懼湪/WEB-INF/tld鐩綍涓?br /> 淇敼/WEB-INF/web.xml鏂囦歡鍔犲叆濡備笅鍐呭


<taglib>
    
<taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>
    
<taglib-location>/WEB-INF/tld/fmt.tld</taglib-location>
</taglib> 

<taglib>
    
<taglib-uri>http://java.sun.com/jstl/fmt-rt</taglib-uri>
    
<taglib-location>/WEB-INF/tld/fmt-1_0-rt.tld</taglib-location>
</taglib> 

<taglib>
    
<taglib-uri>http://java.sun.com/jstl/core</taglib-uri>
    
<taglib-location>/WEB-INF/tld/c.tld</taglib-location>
</taglib> 

<taglib>
    
<taglib-uri>http://java.sun.com/jstl/core-rt</taglib-uri>
    
<taglib-location>/WEB-INF/tld/c-1_0-rt.tld</taglib-location>
</taglib> 

<taglib>
    
<taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
    
<taglib-location>/WEB-INF/tld/sql.tld</taglib-location>
</taglib> 

<taglib>
    
<taglib-uri>http://java.sun.com/jstl/sql-rt</taglib-uri>
    
<taglib-location>/WEB-INF/tld/sql-1_0-rt.tld</taglib-location>
</taglib> 

<taglib>
    
<taglib-uri>http://java.sun.com/jstl/x</taglib-uri>
    
<taglib-location>/WEB-INF/tld/x.tld</taglib-location>
</taglib> 

<taglib>
    
<taglib-uri>http://java.sun.com/jstl/x-rt</taglib-uri>
    
<taglib-location>/WEB-INF/tld/x-1_0-rt.tld</taglib-location>
</taglib>
鍏跺疄鍙互鏍規(guī)嵁浣跨敤鐨勬儏鍐?浠呭皢闇瑕佺殑tld鍔犲叆鍒板伐紼?br /> 甯冪疆濂戒簡.jar鏂囦歡鍜?tld鏂囦歡,浠ュ強淇敼浜唚eb.xml鏂囦歡鍚?灝卞彲浠ュ湪JSP欏甸潰閲岃瘯璇旿STL鏍囩鐨勯瓍鍔涗簡
stulist.jsp
 1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
 2 
 3 <%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
 4 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 5 
 6 
 7 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 8 <html>
 9   <head>
10     <title>page</title>
11   </head>
12   
13   <sql:query var="rs" dataSource="ks2">
14       SELECT * FROM STU
15   </sql:query>
16   
17   <body>
18       <h3>瀛︾敓鎯呭喌<br>
19       <TABLE align="center" border="1" width="95%">
20           <tr><td>搴忓彿</td><td>瀛﹀彿</td><td>濮撳悕</td></tr>
21           
22           <c:forEach var="row" items="${rs.rows}" varStatus="stat">
23               <tr><td>${stat.count}</td><td>${row.stunum}</td><td>${row.stuname}</td></tr>
24           </c:forEach>
25           
26       </TABLE>
27   </body>
28 </html>
榪欐牱鐨勯〉闈技涔庣畝媧佸浜?鐪嬬潃灝變竴涓瓧"娓呯埥":)

鍦ㄨ繖閲岃繕寰楄ˉ鍏呬竴涓?鎴戞槸鍦↗BOSS涓嬪仛鐨?鍦?lt;sql:query>鏍囩閲屾寚瀹歞ataSource閲岀鍒扮偣闂,鎴戠殑鏁版嵁婧愭槸鍦╦boss4\server\default\deploy\mysql-ds.xml閲岄厤緗殑,閰嶇疆鐨勬暟鎹簮鍚嶅瓧鏄痥s,鍙湪榪愯榪欎釜欏甸潰鏃舵繪槸鎻愮ず鎵句笉鍒版暟鎹簮,鏌ヤ簡涓浜涜祫鏂欏彂鐜伴棶棰樻墍鍦?瑕佽JSTL鑳藉欏哄埄浣跨敤JNDI鐨凞ataSource,榪樺緱鍦╳eb.xml鍜宩boss-web.xml閲屽仛淇敼,濂借搴旂敤紼嬪簭鍙互鎵懼埌JNDI鐨勬湇鍔?鍦?WEB-INF/涓嬫柊寤轟竴鏂囦歡jboss-web.xml,鍏跺唴瀹瑰涓?br />
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
    
<resource-ref>
        
<res-ref-name>ks2</res-ref-name>
        
<jndi-name>java:ks</jndi-name>
    
</resource-ref>
</jboss-web>
鐒跺悗鍦╳eb.xml閲屽姞濡備笅闈㈢殑鍐呭
<resource-ref>
  
<res-ref-name>ks2</res-ref-name>
  
<res-type>javax.sql.DataSource</res-type>
  
<res-auth>Container</res-auth>
</resource-ref>
榪欐牱澶勭悊涔嬪悗,鍦↗BOSS涓嬌鐢↗STL鏁版嵁婧愮殑闂灝辮В鍐充簡
鍒鋒柊欏甸潰,甯屾湜鐪嬪埌鐨勭粨鏋滃嚭鏉ヤ簡,OK!
浠婂ぉ緇堜簬浣撻獙涓浜嗕笅JSTL,鐪熸槸閰峰搰,欏甸潰姣斾互鍓嶅啓鐨勭畝媧佸浜?鐪嬫潵寰楁壘涓椂闂村ソ濂藉涔犱竴涓嬭繖涓笢涓滀簡



ZhouFeng 2008-09-08 23:10 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 亚洲av无码一区二区三区在线播放| 亚洲人成电影福利在线播放| ZZIJZZIJ亚洲日本少妇JIZJIZ| 久久久青草青青国产亚洲免观| 国产亚洲精品自在久久| 久久久亚洲裙底偷窥综合| 亚洲情A成黄在线观看动漫软件| 性色av极品无码专区亚洲 | 久久亚洲精品中文字幕无码| 亚洲黄网在线观看| 亚洲午夜无码毛片av久久京东热| 青青草国产免费国产是公开 | 亚洲成a人无码亚洲成www牛牛| 免费视频精品一区二区| 日韩免费的视频在线观看香蕉| 国产麻豆视频免费观看| 亚洲av日韩av欧v在线天堂| 亚洲av日韩综合一区在线观看| 国产成人精品日本亚洲专一区| 杨幂最新免费特级毛片| 88av免费观看入口在线| 国产美女被遭强高潮免费网站| 国产V亚洲V天堂无码| 国产亚洲福利在线视频| 久久免费99精品国产自在现线| 99爱在线精品免费观看| 亚洲国产精品一区二区九九 | 午夜在线亚洲男人午在线| 国产精品偷伦视频观看免费| 夫妻免费无码V看片| 国产亚洲综合成人91精品| 中文字幕在线日亚洲9| 中国一级特黄高清免费的大片中国一级黄色片 | 亚洲成AV人片在线播放无码| 亚洲精品女同中文字幕| 国产成人免费视频| 亚洲av高清在线观看一区二区| 亚洲国产美女福利直播秀一区二区| 丰满少妇作爱视频免费观看| 免费精品国偷自产在线在线 | 国产精品无码素人福利免费|