锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲一区二区在线视频,中文在线二区,香蕉精品久久http://www.aygfsteel.com/zhangrenquan/category/40528.htmlzh-cnMon, 29 Jun 2009 09:46:23 GMTMon, 29 Jun 2009 09:46:23 GMT60瀹炵幇l(fā)og4j鏃ュ織鏂囦歡鍦ㄧ浉瀵硅礬寰勪繚瀛?/title><link>http://www.aygfsteel.com/zhangrenquan/articles/284624.html</link><dc:creator>kelven</dc:creator><author>kelven</author><pubDate>Mon, 29 Jun 2009 08:11:00 GMT</pubDate><guid>http://www.aygfsteel.com/zhangrenquan/articles/284624.html</guid><wfw:comment>http://www.aygfsteel.com/zhangrenquan/comments/284624.html</wfw:comment><comments>http://www.aygfsteel.com/zhangrenquan/articles/284624.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/zhangrenquan/comments/commentRss/284624.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/zhangrenquan/services/trackbacks/284624.html</trackback:ping><description><![CDATA[<p><span id="wmqeeuq" class="Apple-style-span" style="font-weight: normal; font-size: 12px; word-spacing: 0px; text-transform: none; color: rgb(0,0,0); text-indent: 0px; line-height: 18px; font-style: normal; white-space: normal; letter-spacing: normal; border-collapse: separate; text-align: left; font-variant: normal; orphans: 2; widows: 2"><span id="wmqeeuq" class="hilite1" style="background-color: rgb(255,255,0)">Log4j</span>鏃ュ織杈撳嚭璺緞鍙兘璁懼畾鎴愮粷瀵硅礬寰勶紝榪欎釜鍦╳eb欏圭洰涓氨鍙樺緱寰堜笉鏂逛究浜嗐?span class="Apple-converted-space"> </span><br /> 姣斿鎴戞兂瑕佽瀹氭棩蹇椾繚瀛樺湪webapp/log<span id="wmqeeuq" class="Apple-converted-space"> </span><br /> <br /> 鍙傝冧簡緗戜笂璧勬枡錛?span class="Apple-converted-space"> </span><br /> <a style="color: rgb(16,138,198); text-decoration: underline" target="_blank">http://hi.baidu.com/suofang/blog/item/6cf2befbd1ff07234f4aea90.html</a><span id="wmqeeuq" class="Apple-converted-space"> </span><br /> 涓嬮潰鏄紩鍏ュ唴瀹癸細(xì)<span id="wmqeeuq" class="Apple-converted-space"> </span><br /> <br /> 鏂規(guī)硶涓涓昏鏄墿灞曚簡<span id="wmqeeuq" class="hilite1" style="background-color: rgb(255,255,0)">log4j</span>鐨凴ollingFileAppender綾伙紝鍏朵粬鐨凢ileAppender鍚屾牱閬撶悊銆傛墿灞曠殑鏂規(guī)硶錛屽氨鏄敤涓涓瓙綾誨幓瑕嗙洊setFile鏂規(guī)硶錛岃繖涓柟娉曞湪<span id="wmqeeuq" class="hilite1" style="background-color: rgb(255,255,0)">log4j</span>璇誨彇閰嶇疆鏂囦歡鐢熸垚appender鐨勬椂鍊欒皟鐢紝浼犲叆鐨勫氨鏄厤緗枃浠朵腑鐨勮礬寰勶紝榪欐牱鎴戝氨鍙互鎸夌収鑷繁鐨勬兂娉曞湪璺緞鍓嶉潰鍔犱笂鏍硅礬寰勪簡銆傝繖縐嶆柟娉曞彲浠ュ湪<span id="wmqeeuq" class="hilite1" style="background-color: rgb(255,255,0)">log4j</span>.properties涓敤鐩稿璺緞鑷敱閰嶇疆<span id="wmqeeuq" class="hilite1" style="background-color: rgb(255,255,0)">log4j</span>.appender.A1.File灞炴ф潵鍐沖畾鐢熸垚鐨勬棩蹇楃浉瀵箇eb搴旂敤鏍圭洰褰曠殑浣嶇疆銆?span class="Apple-converted-space"> </span><br /> <br /> 鏂規(guī)硶浜屾槸鍒╃敤鏈嶅姟鍣╲m涓凡緇忓瓨鍦ㄧ殑鐜鍙橀噺濡?{catalina.home}鏉ヨ緗浉瀵逛簬${catalina.home}鐨勬棩蹇楄礬寰勶紝鏃ュ織鍙兘鏀懼埌鏈嶅姟鍣ㄥ瓙鐩綍閲岋紝鑰屼笖濡傛灉鏄敤鐨勫叾瀹冩湇鍔″櫒錛屽垯瑕佹敼瀵瑰簲鐨勭幆澧冨彉閲忋傛鏂規(guī)硶騫沖彴縐繪涓嶆柟渚褲?span class="Apple-converted-space"> </span><br /> <br /> 鏂規(guī)硶涓夋槸鎵╁睍ActionServlet綾伙紝瑕嗙洊鍏秈nit()鏂規(guī)硶錛屾柊鏂規(guī)硶涓澆鍏?span class="hilite1" style="background-color: rgb(255,255,0)">log4j</span>.properties浣嶇疆鐨勫弬鏁幫紝鍙互鑷敱閰嶇疆<span id="wmqeeuq" class="hilite1" style="background-color: rgb(255,255,0)">log4j</span>鐨勯厤緗枃浠剁殑鍚嶅瓧鍜屽瓨鏀句綅緗備篃鍙嚜鐢遍厤緗?span class="hilite1" style="background-color: rgb(255,255,0)">log4j</span>鏃ュ織鏂囦歡鐨勭浉瀵逛簬褰撳墠搴旂敤鐨勮礬寰勩?span class="Apple-converted-space"> </span><br /> <br /> 瀵逛簬絎笁涓柟娉曪紝浣滆呮彁鍑轟簡涓棶棰橈細(xì)<span id="wmqeeuq" class="Apple-converted-space"> </span><br /> <span id="wmqeeuq" class="hilite1" style="background-color: rgb(255,255,0)">log4j</span>閰嶇疆鏂囦歡鐨勪綅緗紝涓嶈鍏跺湪<span id="wmqeeuq" class="hilite2" style="background-color: rgb(85,255,85)">web-inf</span>/classes鐩綍錛屽洜涓哄湪鍔犺澆姝ervlet涔嬪墠錛屾湇鍔″櫒濡倀omcat鍚姩鏃朵細(xì)鑷姩鎼滅儲<span id="wmqeeuq" class="hilite2" style="background-color: rgb(85,255,85)">web-inf</span>鐩綍鍜?span class="hilite2" style="background-color: rgb(85,255,85)">web-inf</span>/classes鐩綍涓?span class="hilite1" style="background-color: rgb(255,255,0)">log4j</span>.properties鏂囦歡錛屽鏈夊垯鑷姩鍔犺澆銆?span class="hilite1" style="background-color: rgb(255,255,0)">log4j</span>灞炴ф枃浠跺姞杞藉悗,鐢變簬璇ュ睘鎬ф枃浠朵腑<span id="wmqeeuq" class="hilite1" style="background-color: rgb(255,255,0)">log4j</span>.appender.A1.File鐨勫肩敤鐨勬槸鐩稿璺緞錛岃嚜鍔ㄥ姞杞介厤緗究浼?xì)鍑洪敊锛?xì)<span id="wmqeeuq" class="Apple-converted-space"> </span><br /> <span id="wmqeeuq" class="hilite1" style="background-color: rgb(255,255,0)">log4j</span>:ERROR setFile(null,true) call failed.<span id="wmqeeuq" class="Apple-converted-space"> </span><br /> java.io.FileNotFoundException:<span id="wmqeeuq" class="Apple-converted-space"> </span><span id="wmqeeuq" class="hilite2" style="background-color: rgb(85,255,85)">WEB-INF</span>\logs\bysxxglxt.log<span id="wmqeeuq" class="Apple-converted-space"> </span><br /> (緋葷粺鎵句笉鍒版寚瀹氱殑璺緞銆?<span id="wmqeeuq" class="Apple-converted-space"> </span><br /> <br /> 灝界鍚庨潰鍔犺澆鎵╁睍鐨凙ctionServlet涓紜緗簡<span id="wmqeeuq" class="hilite1" style="background-color: rgb(255,255,0)">log4j</span>灞炴ф枃浠跺茍姝e父鍔犺澆浜嗭紝浣嗚繕鏄姤鐨勮繖涓敊錛屾笉鐖界殑銆傚彧鏈夋洿鏀?span class="hilite1" style="background-color: rgb(255,255,0)">log4j</span>灞炴ф枃浠跺悕瀛楁垨鑰呮洿鏀瑰叾瀛樻斁浣嶇疆錛岃鍏朵笉鑳借嚜鍔ㄥ姞杞戒簡錛屼笉榪囪繕鏄湁涓や釜璀﹀憡錛?span class="Apple-converted-space"> </span><br /> <span id="wmqeeuq" class="hilite1" style="background-color: rgb(255,255,0)">log4j</span>:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax).<span id="wmqeeuq" class="Apple-converted-space"> </span><br /> <span id="wmqeeuq" class="hilite1" style="background-color: rgb(255,255,0)">log4j</span>:WARN Please initialize the<span id="wmqeeuq" class="Apple-converted-space"> </span><span id="wmqeeuq" class="hilite1" style="background-color: rgb(255,255,0)">log4j</span><span id="wmqeeuq" class="Apple-converted-space"> </span>system properly.<span id="wmqeeuq" class="Apple-converted-space"> </span><br /> <br /> 鏂扮殑鍙戠幇錛?span class="Apple-converted-space"> </span><br /> 鐢變簬spring涔熶細(xì)鍔犺澆<span id="wmqeeuq" class="hilite1" style="background-color: rgb(255,255,0)">log4j</span>.properties錛屽鏋滃姞杞戒笉鍒板氨寰鎺у埗鍙版墦log淇℃伅錛屾昏寰楁湁浜涚鐪鹼紝浜庢槸鎯沖姙娉曞幓鎺夈係pring鎻愪緵浜嗕竴涓狶og4jConfigListener錛屾湰韜氨鑳介氳繃web.xml涓厤緗潵鎸囧畾浣嶇疆鍔犺澆<span id="wmqeeuq" class="hilite1" style="background-color: rgb(255,255,0)">log4j</span>閰嶇疆鏂囦歡鍜宭og杈撳嚭璺緞錛屾敞鎰忚listener闇瑕佹斁鍦╯pring鐨凩istener涔嬪墠銆?span class="Apple-converted-space"> </span><br /> 浜嬪疄涓婏紝Log4jConfigListener鏇撮傚悎<span id="wmqeeuq" class="hilite1" style="background-color: rgb(255,255,0)">log4j</span>鍦╳eb宸ョ▼涓嬌鐢紝鍘熷洜濡備笅錛?span class="Apple-converted-space"> </span><br /> 1. 鍔ㄦ佺殑鏀瑰彉璁板綍綰у埆鍜岀瓥鐣ワ紝涓嶉渶瑕侀噸鍚疻eb搴旂敤錛屽銆奅ffective Enterprise Java銆嬫墍璇淬?span class="Apple-converted-space"> </span><br />    2. 鎶妉og鏂囦歡瀹氬湪 /<span id="wmqeeuq" class="hilite2" style="background-color: rgb(85,255,85)">WEB-INF</span>/logs/ 鑰屼笉闇瑕佸啓緇濆璺緞銆?span class="Apple-converted-space"> </span><br /> 鍥犱負(fù) 緋葷粺鎶妛eb鐩綍鐨勮礬寰勫帇鍏ヤ竴涓彨webapp.root鐨勭郴緇熷彉閲忋傝繖鏍峰啓log鏂囦歡璺緞鏃朵笉鐢ㄥ啓緇濆璺緞浜?<span id="wmqeeuq" class="Apple-converted-space"> </span><br /> <span id="wmqeeuq" class="hilite1" style="background-color: rgb(255,255,0)">log4j</span>.appender.logfile.File=${webapp.root}/<span id="wmqeeuq" class="hilite2" style="background-color: rgb(85,255,85)">WEB-INF</span>/logs/myfuse.log<span id="wmqeeuq" class="Apple-converted-space"> </span><br />    3. 鍙互鎶?span class="hilite1" style="background-color: rgb(255,255,0)">log4j</span>.properties鍜屽叾浠杙roperties涓璧鋒斁鍦?<span id="wmqeeuq" class="hilite2" style="background-color: rgb(85,255,85)">WEB-INF</span>/ 錛岃屼笉鏄疌lass-Path銆?span class="Apple-converted-space"> </span><br />    4.log4jRefreshInterval涓?0000琛ㄧず 寮涓鏉atchdog綰跨▼姣?0縐掓壂鎻忎竴涓嬮厤緗枃浠剁殑鍙樺寲;<span id="wmqeeuq" class="Apple-converted-space"> </span><br />    鍦╳eb.xml 娣誨姞<span id="wmqeeuq" class="Apple-converted-space"> </span><br /> </p> <div id="wmqeeuq" class="dp-highlighter" style="padding-right: 1px; padding-left: 1px; font-size: 12px; padding-bottom: 1px; margin-left: 9px; overflow: auto; width: 97%; padding-top: 1px; background-color: transparent"> <div id="wmqeeuq" class="bar"> <div id="wmqeeuq" class="tools" style="padding-right: 3px; padding-left: 3px; font-weight: bold; padding-bottom: 3px; margin: 0px; color: black; padding-top: 3px; text-align: left">Xml浠g爜<span id="wmqeeuq" class="Apple-converted-space"> </span></embed></div> </div> <ol class="dp-xml" style="border-right: rgb(209,215,220) 1px solid; padding-right: 0px; border-top: rgb(209,215,220) 1px solid; padding-left: 0px; font-size: 1em; padding-bottom: 2px; margin: 0px 0px 1px; border-left: rgb(209,215,220) 1px solid; color: rgb(43,145,175); line-height: 1.4em; padding-top: 2px; border-bottom: rgb(209,215,220) 1px solid; list-style-type: decimal; background-color: rgb(255,255,255)"> <li style="padding-right: 0px; padding-left: 10px; font-size: 1em; padding-bottom: 0px; margin: 0px 0px 0px 38px; border-left: rgb(209,215,220) 1px solid; line-height: 18px; padding-top: 0px; background-color: rgb(250,250,250)"><span style="color: black"><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)"><</span><span id="wmqeeuq" class="tag-name" style="font-weight: bold; color: rgb(0,102,153)">context-param</span><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)">></span><span style="color: black">  </span></span> <li style="padding-right: 0px; padding-left: 10px; font-size: 1em; padding-bottom: 0px; margin: 0px 0px 0px 38px; border-left: rgb(209,215,220) 1px solid; line-height: 18px; padding-top: 0px; background-color: rgb(250,250,250)"><span style="color: black">    <span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)"><</span><span id="wmqeeuq" class="tag-name" style="font-weight: bold; color: rgb(0,102,153)">param-name</span><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)">></span><span style="color: black">log4jConfigLocation</span><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)"></</span><span id="wmqeeuq" class="tag-name" style="font-weight: bold; color: rgb(0,102,153)">param-name</span><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)">></span><span style="color: black">  </span></span> <li style="padding-right: 0px; padding-left: 10px; font-size: 1em; padding-bottom: 0px; margin: 0px 0px 0px 38px; border-left: rgb(209,215,220) 1px solid; line-height: 18px; padding-top: 0px; background-color: rgb(250,250,250)"><span style="color: black">    <span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)"><</span><span id="wmqeeuq" class="tag-name" style="font-weight: bold; color: rgb(0,102,153)">param-value</span><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)">></span><span style="color: black"><span id="wmqeeuq" class="hilite2" style="color: black; background-color: rgb(85,255,85)">WEB-INF</span>/<span id="wmqeeuq" class="hilite1" style="color: black; background-color: rgb(255,255,0)">log4j</span>.properties</span><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)"></</span><span id="wmqeeuq" class="tag-name" style="font-weight: bold; color: rgb(0,102,153)">param-value</span><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)">></span><span style="color: black">  </span></span> <li style="padding-right: 0px; padding-left: 10px; font-size: 1em; padding-bottom: 0px; margin: 0px 0px 0px 38px; border-left: rgb(209,215,220) 1px solid; line-height: 18px; padding-top: 0px; background-color: rgb(250,250,250)"><span style="color: black"><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)"></</span><span id="wmqeeuq" class="tag-name" style="font-weight: bold; color: rgb(0,102,153)">context-param</span><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)">></span><span style="color: black">  </span></span> <li style="padding-right: 0px; padding-left: 10px; font-size: 1em; padding-bottom: 0px; margin: 0px 0px 0px 38px; border-left: rgb(209,215,220) 1px solid; line-height: 18px; padding-top: 0px; background-color: rgb(250,250,250)"><span style="color: black">  </span> <li style="padding-right: 0px; padding-left: 10px; font-size: 1em; padding-bottom: 0px; margin: 0px 0px 0px 38px; border-left: rgb(209,215,220) 1px solid; line-height: 18px; padding-top: 0px; background-color: rgb(250,250,250)"><span style="color: black"><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)"><</span><span id="wmqeeuq" class="tag-name" style="font-weight: bold; color: rgb(0,102,153)">context-param</span><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)">></span><span style="color: black">  </span></span> <li style="padding-right: 0px; padding-left: 10px; font-size: 1em; padding-bottom: 0px; margin: 0px 0px 0px 38px; border-left: rgb(209,215,220) 1px solid; line-height: 18px; padding-top: 0px; background-color: rgb(250,250,250)"><span style="color: black">    <span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)"><</span><span id="wmqeeuq" class="tag-name" style="font-weight: bold; color: rgb(0,102,153)">param-name</span><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)">></span><span style="color: black">log4jRefreshInterval</span><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)"></</span><span id="wmqeeuq" class="tag-name" style="font-weight: bold; color: rgb(0,102,153)">param-name</span><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)">></span><span style="color: black">  </span></span> <li style="padding-right: 0px; padding-left: 10px; font-size: 1em; padding-bottom: 0px; margin: 0px 0px 0px 38px; border-left: rgb(209,215,220) 1px solid; line-height: 18px; padding-top: 0px; background-color: rgb(250,250,250)"><span style="color: black">    <span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)"><</span><span id="wmqeeuq" class="tag-name" style="font-weight: bold; color: rgb(0,102,153)">param-value</span><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)">></span><span style="color: black">60000</span><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)"></</span><span id="wmqeeuq" class="tag-name" style="font-weight: bold; color: rgb(0,102,153)">param-value</span><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)">></span><span style="color: black">  </span></span> <li style="padding-right: 0px; padding-left: 10px; font-size: 1em; padding-bottom: 0px; margin: 0px 0px 0px 38px; border-left: rgb(209,215,220) 1px solid; line-height: 18px; padding-top: 0px; background-color: rgb(250,250,250)"><span style="color: black"><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)"></</span><span id="wmqeeuq" class="tag-name" style="font-weight: bold; color: rgb(0,102,153)">context-param</span><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)">></span><span style="color: black">  </span></span> <li style="padding-right: 0px; padding-left: 10px; font-size: 1em; padding-bottom: 0px; margin: 0px 0px 0px 38px; border-left: rgb(209,215,220) 1px solid; line-height: 18px; padding-top: 0px; background-color: rgb(250,250,250)"><span style="color: black">  </span> <li style="padding-right: 0px; padding-left: 10px; font-size: 1em; padding-bottom: 0px; margin: 0px 0px 0px 38px; border-left: rgb(209,215,220) 1px solid; line-height: 18px; padding-top: 0px; background-color: rgb(250,250,250)"><span style="color: black"><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)"><</span><span id="wmqeeuq" class="tag-name" style="font-weight: bold; color: rgb(0,102,153)">listener</span><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)">></span><span style="color: black">  </span></span> <li style="padding-right: 0px; padding-left: 10px; font-size: 1em; padding-bottom: 0px; margin: 0px 0px 0px 38px; border-left: rgb(209,215,220) 1px solid; line-height: 18px; padding-top: 0px; background-color: rgb(250,250,250)"><span style="color: black">    <span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)"><</span><span id="wmqeeuq" class="tag-name" style="font-weight: bold; color: rgb(0,102,153)">listener-class</span><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)">></span><span style="color: black">org.springframework.web.util.Log4jConfigListener</span><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)"></</span><span id="wmqeeuq" class="tag-name" style="font-weight: bold; color: rgb(0,102,153)">listener-class</span><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)">></span><span style="color: black">  </span></span> <li style="padding-right: 0px; padding-left: 10px; font-size: 1em; padding-bottom: 0px; margin: 0px 0px 0px 38px; border-left: rgb(209,215,220) 1px solid; line-height: 18px; padding-top: 0px; background-color: rgb(250,250,250)"><span style="color: black"><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)"></</span><span id="wmqeeuq" class="tag-name" style="font-weight: bold; color: rgb(0,102,153)">listener</span><span id="wmqeeuq" class="tag" style="font-weight: bold; color: rgb(0,102,153)">></span><span style="color: black">   <br /> </span></span></li> </ol> </div> </span><img src ="http://www.aygfsteel.com/zhangrenquan/aggbug/284624.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/zhangrenquan/" target="_blank">kelven</a> 2009-06-29 16:11 <a href="http://www.aygfsteel.com/zhangrenquan/articles/284624.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>jsp楠岃瘉鐮?/title><link>http://www.aygfsteel.com/zhangrenquan/articles/284617.html</link><dc:creator>kelven</dc:creator><author>kelven</author><pubDate>Mon, 29 Jun 2009 07:47:00 GMT</pubDate><guid>http://www.aygfsteel.com/zhangrenquan/articles/284617.html</guid><wfw:comment>http://www.aygfsteel.com/zhangrenquan/comments/284617.html</wfw:comment><comments>http://www.aygfsteel.com/zhangrenquan/articles/284617.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/zhangrenquan/comments/commentRss/284617.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/zhangrenquan/services/trackbacks/284617.html</trackback:ping><description><![CDATA[<p><%@ page language="java" pageEncoding="UTF-8"%><br /> <%@ pagecontentType<br /> ="image/jpeg" import="java.awt.*,java.awt.image.*,java.util.*,javax.imageio.*,com.swetake.util.Qrcode"%><br /> <%!Color getRandColor(int fc, int bc) {//緇欏畾鑼冨洿鑾峰緱闅忔満棰滆壊<br />    Random random = new Random();<br />    if (fc > 255)<br />     fc = 255;<br />    if (bc > 255)<br />     bc = 255;<br />    int r = fc + random.nextInt(bc - fc);<br />    int g = fc + random.nextInt(bc - fc);<br />    int b = fc + random.nextInt(bc - fc);<br />    return new Color(r, g, b);<br /> }%><br /> <%<br /> //璁劇疆欏甸潰涓嶇紦瀛?br /> response.setHeader("Pragma", "No-cache");<br /> response.setHeader("Cache-Control", "no-cache");<br /> response.setDateHeader("Expires", 0);</p> <p>//    鍦ㄥ唴瀛樹腑鍒涘緩鍥捐薄<br /> int width = 60, height = 20;<br /> BufferedImage image = new BufferedImage(width, height,<br />     BufferedImage.TYPE_INT_RGB);</p> <p>//    鑾峰彇鍥懼艦涓婁笅鏂?br /> Graphics g = image.getGraphics();</p> <p>//鐢熸垚闅忔満綾?br /> Random random = new Random();</p> <p>//    璁懼畾鑳屾櫙鑹?br /> g.setColor(getRandColor(200, 250));<br /> g.fillRect(0, 0, width, height);</p> <p>//璁懼畾瀛椾綋<br /> g.setFont(new Font("Comic    Sans    MS", Font.PLAIN, 20));</p> <p>//鐢昏竟妗?br /> //g.setColor(new    Color());<br /> //g.drawRect(0,0,width-1,height-1);</p> <p>//    闅忔満浜х敓155鏉″共鎵扮嚎錛屼嬌鍥捐薄涓殑璁よ瘉鐮佷笉鏄撹鍏跺畠紼嬪簭鎺㈡祴鍒?br /> g.setColor(getRandColor(160, 200));<br /> for (int i = 0; i < 155; i++) {<br />    int x = random.nextInt(width);<br />    int y = random.nextInt(height);<br />    int xl = random.nextInt(12);<br />    int yl = random.nextInt(12);<br />    g.drawLine(x, y, x + xl, y + yl);<br /> }</p> <p>//    鍙栭殢鏈轟駭鐢熺殑璁よ瘉鐮?4浣嶆暟瀛?<br /> String sRand = "";<br /> for (int i = 0; i < 4; i++) {<br />    String rand = String.valueOf(random.nextInt(10));<br />    sRand += rand;<br />    //    灝嗚璇佺爜鏄劇ず鍒板浘璞′腑<br />    g.setColor(new Color(20 + random.nextInt(110), 20 + random   .nextInt(110), 20 + random.nextInt(110)));<br />    //璋冪敤鍑芥暟鍑烘潵鐨勯鑹茬浉鍚岋紝鍙兘鏄洜涓虹瀛愬お鎺ヨ繎錛屾墍浠ュ彧鑳界洿鎺ョ敓鎴?br />    g.drawString(rand, 13 * i + 6, 16);<br /> }</p> <p>//    灝嗚璇佺爜瀛樺叆SESSION<br /> session.setAttribute("rand", sRand);</p> <p><br /> //    鍥捐薄鐢熸晥<br /> g.dispose();<br /> out.clear();<br /> out = pageContext.pushBody();</p> <p>//    杈撳嚭鍥捐薄鍒伴〉闈?br /> ImageIO.write(image, "JPEG", response.getOutputStream());<br /> %></p> <p> <br /> <br /> <span style="color: red">娉?瑕佸厛涓嬭澆com.swetake.util.Qrcode鍖?/span><br /> </p><img src ="http://www.aygfsteel.com/zhangrenquan/aggbug/284617.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/zhangrenquan/" target="_blank">kelven</a> 2009-06-29 15:47 <a href="http://www.aygfsteel.com/zhangrenquan/articles/284617.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <a href="http://www.aygfsteel.com/" title="狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频">狠狠久久亚洲欧美专区_中文字幕亚洲综合久久202_国产精品亚洲第五区在线_日本免费网站视频</a> </div> </footer> 主站蜘蛛池模板: <a href="http://" target="_blank">沁水县</a>| <a href="http://" target="_blank">呈贡县</a>| <a href="http://" target="_blank">正安县</a>| <a href="http://" target="_blank">佛冈县</a>| <a href="http://" target="_blank">泰顺县</a>| <a href="http://" target="_blank">宁化县</a>| <a href="http://" target="_blank">房山区</a>| <a href="http://" target="_blank">隆子县</a>| <a href="http://" target="_blank">旺苍县</a>| <a href="http://" target="_blank">厦门市</a>| <a href="http://" target="_blank">襄汾县</a>| <a href="http://" target="_blank">哈巴河县</a>| <a href="http://" target="_blank">安顺市</a>| <a href="http://" target="_blank">乐陵市</a>| <a href="http://" target="_blank">禄劝</a>| <a href="http://" target="_blank">天门市</a>| <a href="http://" target="_blank">和顺县</a>| <a href="http://" target="_blank">勐海县</a>| <a href="http://" target="_blank">寿宁县</a>| <a href="http://" target="_blank">大港区</a>| <a href="http://" target="_blank">三门县</a>| <a href="http://" target="_blank">灵武市</a>| <a href="http://" target="_blank">抚州市</a>| <a href="http://" target="_blank">都江堰市</a>| <a href="http://" target="_blank">陈巴尔虎旗</a>| <a href="http://" target="_blank">阳曲县</a>| <a href="http://" target="_blank">江西省</a>| <a href="http://" target="_blank">凤庆县</a>| <a href="http://" target="_blank">七台河市</a>| <a href="http://" target="_blank">桃江县</a>| <a href="http://" target="_blank">南丹县</a>| <a href="http://" target="_blank">岗巴县</a>| <a href="http://" target="_blank">阿瓦提县</a>| <a href="http://" target="_blank">沽源县</a>| <a href="http://" target="_blank">宝坻区</a>| <a href="http://" target="_blank">东乡族自治县</a>| <a href="http://" target="_blank">乌海市</a>| <a href="http://" target="_blank">门头沟区</a>| <a href="http://" target="_blank">专栏</a>| <a href="http://" target="_blank">靖边县</a>| <a href="http://" target="_blank">兴安县</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>