锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久激情亚洲精品无码?V,亚洲国产精品不卡在线电影,亚洲中文字幕人成乱码http://m.tkk7.com/rory/category/8718.htmlHappy study,Happy work,Happy lifezh-cnWed, 28 Feb 2007 07:42:26 GMTWed, 28 Feb 2007 07:42:26 GMT60xstream瀵箈mlnode鐨勫睘鎬?attribute)瑙f瀽鐨勯棶棰榌鏇存柊]銆?/title><link>http://m.tkk7.com/rory/archive/2007/01/17/howto-dealwith-xstream-xmlnode-attribute.html</link><dc:creator>鑾</dc:creator><author>鑾</author><pubDate>Wed, 17 Jan 2007 10:24:00 GMT</pubDate><guid>http://m.tkk7.com/rory/archive/2007/01/17/howto-dealwith-xstream-xmlnode-attribute.html</guid><wfw:comment>http://m.tkk7.com/rory/comments/94475.html</wfw:comment><comments>http://m.tkk7.com/rory/archive/2007/01/17/howto-dealwith-xstream-xmlnode-attribute.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://m.tkk7.com/rory/comments/commentRss/94475.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/rory/services/trackbacks/94475.html</trackback:ping><description><![CDATA[xstream鏄釜濂戒笢瑗褲傚浜庨厤緗枃浠剁殑璇誨彇寰堟柟渚褲傚湪mybog涓垜灝辯敤鍒頒簡銆備笉榪囦粖澶╂墦綆楃敤yupoo鐨刟pi鏉ュ仛鐩稿唽銆傚彂鐜皒stream瀵逛簬xmlnode鐨刟ttribute瑙f瀽鏀寔涓嶆槸閭d箞鐨勫ソ銆?br />瀵逛簬榪欑鑺傜偣鏍煎紡鐨勯潪甯哥殑綆鍗?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);"><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">result</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);">page</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">page</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);">pages</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">pages</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);">perpage</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">100</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">perpage</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);">total</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">19</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">total</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);">photos</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);">photo</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);">id</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">ff8080810fc8ac78010fd3f158d40a52</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">id</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);">owner</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">ff8080810f1a387b010f1a83d6530dfc</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">owner</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);">title</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">Gmail-2</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 />聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">host</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">4</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">host</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);">dir</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">20061230</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">dir</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);">filename</span><span style="color: rgb(0, 0, 255);">></span><span style="color: rgb(0, 0, 0);">231905_1463411198</span><span style="color: rgb(0, 0, 255);"></</span><span style="color: rgb(128, 0, 0);">filename</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);">photo</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);">photos</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);">result</span><span style="color: rgb(0, 0, 255);">></span></div><br />綆鍗曠殑alias涓涓嬪氨鍙互璇誨埌鍊間簡<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);"><span style="color: rgb(0, 0, 0);">File聽file聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽File(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">src/test/java/com/jdkcn/test/result.xml</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />BufferedReader聽reader聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽BufferedReader(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽InputStreamReader(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽FileInputStream(file),聽</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">UTF-8</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br />XStream聽stream聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽XStream();<br />stream.alias(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">result</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,聽YupooResult.</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">);<br />stream.alias(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">photo</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,YupooPhoto.</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">);<br />YupooResult聽result聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽(YupooResult)stream.fromXML(reader);</span></div>鍙槸Yupoo鐨刟pi榪斿洖鐨剎mlrpc鐨勭粨鏋滄槸榪欐牱鐨?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);"><span style="color: rgb(0, 0, 255);"><</span><span style="color: rgb(128, 0, 0);">result聽</span><span style="color: rgb(255, 0, 0);">page</span><span style="color: rgb(0, 0, 255);">="1"</span><span style="color: rgb(255, 0, 0);">聽pages</span><span style="color: rgb(0, 0, 255);">="1"</span><span style="color: rgb(255, 0, 0);">聽perpage</span><span style="color: rgb(0, 0, 255);">="100"</span><span style="color: rgb(255, 0, 0);">聽total</span><span style="color: rgb(0, 0, 255);">="19"</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);">photos</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);">photo聽</span><span style="color: rgb(255, 0, 0);">id</span><span style="color: rgb(0, 0, 255);">="ff8080810fc8ac78010fd3f158d40a52"</span><span style="color: rgb(255, 0, 0);"><br />聽聽聽聽聽聽聽聽聽聽聽聽owner</span><span style="color: rgb(0, 0, 255);">="ff8080810f1a387b010f1a83d6530dfc"</span><span style="color: rgb(255, 0, 0);">聽title</span><span style="color: rgb(0, 0, 255);">="Gmail-2"</span><span style="color: rgb(255, 0, 0);">聽host</span><span style="color: rgb(0, 0, 255);">="4"</span><span style="color: rgb(255, 0, 0);"><br />聽聽聽聽聽聽聽聽聽聽聽聽dir</span><span style="color: rgb(0, 0, 255);">="20061230"</span><span style="color: rgb(255, 0, 0);">聽filename</span><span style="color: rgb(0, 0, 255);">="231905_1463411198"</span><span style="color: rgb(255, 0, 0);">聽</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);">photos</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);">result</span><span style="color: rgb(0, 0, 255);">></span></div>榪欐牱灝眑oad涓嶅埌鍊間簡銆傛病娉曞幓mailist閲岄潰鎵劇瓟妗堬紝鏋滅劧鏈変漢闂?br /><pre><font color="#ff9900">Hello, I am not sure about the subject but here is what I needed help for: XML: <field name="value">I am a Field.</field> I have already tried several structures and nothing seem to work. Is this possible for XStream? :) How is the Java class form to support this? Thanks!</font><br /><br /><br /><br /><br />鏈変漢鍥炵瓟鏄湅Converter鐨勬枃妗c傛灉鐒舵壘鍒扮瓟妗堜簡銆?br />鑷繁鍐欎竴涓猚onverter灝卞彲浠ヤ簡銆?br />涓嬮潰鏄垜鐨刢onverter<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);"><span style="color: rgb(0, 0, 255);">package</span><span style="color: rgb(0, 0, 0);">聽com.jdkcn.xstream;<br /><br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">聽java.util.ArrayList;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">聽java.util.List;<br /><br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">聽com.jdkcn.yupoo.YupooPhoto;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">聽com.jdkcn.yupoo.YupooResult;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">聽com.thoughtworks.xstream.converters.Converter;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">聽com.thoughtworks.xstream.converters.MarshallingContext;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">聽com.thoughtworks.xstream.converters.UnmarshallingContext;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">聽com.thoughtworks.xstream.io.HierarchicalStreamReader;<br /></span><span style="color: rgb(0, 0, 255);">import</span><span style="color: rgb(0, 0, 0);">聽com.thoughtworks.xstream.io.HierarchicalStreamWriter;<br /><br /></span><span style="color: rgb(0, 128, 0);">/**</span><span style="color: rgb(0, 128, 0);"><br />聽*聽</span><span style="color: rgb(128, 128, 128);">@author</span><span style="color: rgb(0, 128, 0);">聽<a聽href="mailto:rory.cn@gmail.com">somebody</a><br />聽*聽</span><span style="color: rgb(128, 128, 128);">@since</span><span style="color: rgb(0, 128, 0);">聽Jan聽16,聽2007聽6:12:35聽PM<br />聽*聽</span><span style="color: rgb(128, 128, 128);">@version</span><span style="color: rgb(0, 128, 0);">聽$Id聽YupooResultConverter.java$<br />聽</span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">聽YupooResultConverter聽</span><span style="color: rgb(0, 0, 255);">implements</span><span style="color: rgb(0, 0, 0);">聽Converter聽{<br />聽聽聽聽</span><span style="color: rgb(0, 128, 0);">/*</span><span style="color: rgb(0, 128, 0);">聽(non-Javadoc)<br />聽聽聽聽聽*聽@see聽com.thoughtworks.xstream.converters.Converter#marshal(java.lang.Object,聽com.thoughtworks.xstream.io.HierarchicalStreamWriter,聽com.thoughtworks.xstream.converters.MarshallingContext)<br />聽聽聽聽聽</span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br />聽聽聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">聽marshal(Object聽obj,聽HierarchicalStreamWriter聽writer,聽MarshallingContext聽context)聽{<br />聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(0, 128, 0);">聽FIXME聽unfinish.</span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">聽聽聽聽}<br /><br />聽聽聽聽</span><span style="color: rgb(0, 128, 0);">/*</span><span style="color: rgb(0, 128, 0);">聽(non-Javadoc)<br />聽聽聽聽聽*聽@see聽com.thoughtworks.xstream.converters.Converter#unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader,聽com.thoughtworks.xstream.converters.UnmarshallingContext)<br />聽聽聽聽聽</span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br />聽聽聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽Object聽unmarshal(HierarchicalStreamReader聽reader,聽UnmarshallingContext聽context)聽{<br />聽聽聽聽聽聽聽聽YupooResult聽result聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽YupooResult();<br />聽聽聽聽聽聽聽聽result.setPage(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽Integer(reader.getAttribute(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">page</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)));<br />聽聽聽聽聽聽聽聽result.setPages(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽Integer(reader.getAttribute(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">pages</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)));<br />聽聽聽聽聽聽聽聽result.setPerpage(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽Integer(reader.getAttribute(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">perpage</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)));<br />聽聽聽聽聽聽聽聽result.setTotal(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽Integer(reader.getAttribute(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">total</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">)));<br />聽聽聽聽聽聽聽聽reader.moveDown();<br />聽聽聽聽聽聽聽聽List</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">YupooPhoto</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);">聽photos聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽ArrayList</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(0, 0, 0);">YupooPhoto</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(0, 0, 0);">();<br />聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">while</span><span style="color: rgb(0, 0, 0);">(reader.hasMoreChildren())聽{<br />聽聽聽聽聽聽聽聽聽聽聽聽reader.moveDown();<br />聽聽聽聽聽聽聽聽聽聽聽聽YupooPhoto聽photo聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽YupooPhoto();<br />聽聽聽聽聽聽聽聽聽聽聽聽photo.setDir(reader.getAttribute(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">dir</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br />聽聽聽聽聽聽聽聽聽聽聽聽photo.setFilename(reader.getAttribute(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">filename</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br />聽聽聽聽聽聽聽聽聽聽聽聽photo.setHost(reader.getAttribute(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">host</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br />聽聽聽聽聽聽聽聽聽聽聽聽photo.setId(reader.getAttribute(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">id</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br />聽聽聽聽聽聽聽聽聽聽聽聽photo.setOwner(reader.getAttribute(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">owner</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br />聽聽聽聽聽聽聽聽聽聽聽聽photo.setTitle(reader.getAttribute(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">title</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">));<br />聽聽聽聽聽聽聽聽聽聽聽聽photos.add(photo);<br />聽聽聽聽聽聽聽聽聽聽聽聽reader.moveUp();<br />聽聽聽聽聽聽聽聽}<br />聽聽聽聽聽聽聽聽result.setPhotos(photos);<br />聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">聽result;<br />聽聽聽聽}<br />聽聽聽聽</span><span style="color: rgb(0, 128, 0);">/*</span><span style="color: rgb(0, 128, 0);">聽(non-Javadoc)<br />聽聽聽聽聽*聽@see聽com.thoughtworks.xstream.converters.ConverterMatcher#canConvert(java.lang.Class)<br />聽聽聽聽聽</span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br />聽聽聽聽</span><span style="color: rgb(0, 0, 255);">public</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">boolean</span><span style="color: rgb(0, 0, 0);">聽canConvert(Class聽clazz)聽{<br />聽聽聽聽聽聽聽聽</span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);">聽clazz.equals(YupooResult.</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">);<br />聽聽聽聽}<br />}<br /></span></div><br />鐒跺悗璋冪敤鐨勫湴鏂逛慨鏀逛竴涓嬪氨ok浜嗐?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);"><span style="color: rgb(0, 0, 0);">XStream聽stream聽</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">聽</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽XStream();<br />stream.registerConverter(</span><span style="color: rgb(0, 0, 255);">new</span><span style="color: rgb(0, 0, 0);">聽YupooResultConverter());<br />stream.alias(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">result</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,聽YupooResult.</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">);</span></div><br /><br /><br />鍙傝?<br /><a >http://xstream.codehaus.org/converter-tutorial.html</a></pre><br />2007騫?鏈?8鏃ユ洿鏂般?br />榪欓噷鎰熻阿緗戝弸 <a id="AjaxHolder_Comments_CommentList_ctl00_NameLink" target="_blank">Ivan Chen錛堣タ婊級</a>聽鐨勬彁紺恒傚師鏉ユ柊鐗堢殑xstream鍙互綆鍗曠殑瑙e喅浜嗐傚湪1.2.1鐨刣oc閲岄潰鎵懼埌浜嗚繖涓袱涓柟娉曘?br /><h3>useAttributeFor</h3><pre>public void <b>useAttributeFor</b>(java.lang.String聽fieldName, java.lang.Class聽type)</pre><dl><dd>Use an XML attribute for a field or a specific type. <p></p></dd><dd><dl><dt><b>Parameters:</b></dt><dd><code>fieldName</code> - the name of the field </dd><dd><code>type</code> - the Class of the type to be rendered as XML attribute </dd><dt><b>Throws:</b></dt><dd><code><a title="class in com.thoughtworks.xstream" >XStream.InitializationException</a></code> - if no <a title="class in com.thoughtworks.xstream.mapper" ><code>AttributeMapper</code></a> is available </dd><dt><b>Since:</b></dt><dd>1.2</dd></dl></dd></dl><hr /><a name="useAttributeFor(java.lang.Class)"><!-- --></a><h3>useAttributeFor</h3><pre>public void <b>useAttributeFor</b>(java.lang.Class聽type)</pre><dl><dd>Use an XML attribute for an arbotrary type. <p></p></dd><dd><dl><dt><b>Parameters:</b></dt><dd><code>type</code> - the Class of the type to be rendered as XML attribute </dd><dt><b>Throws:</b></dt><dd><code><a title="class in com.thoughtworks.xstream" >XStream.InitializationException</a></code> - if no <a title="class in com.thoughtworks.xstream.mapper" ><code>AttributeMapper</code></a> is available </dd><dt><b>Since:</b></dt><dd>1.2</dd></dl></dd></dl><br />榪欎袱涓柟娉曢兘鏄粠1.2寮濮嬫敮鎸佺殑銆?br />涔熶笉鐢ㄨ嚜宸卞啓converter浜嗐傝繖鏍峰氨鍙互浜?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);"><span style="color: rgb(0, 0, 0);">聽聽聽聽聽聽聽聽stream.alias(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">result</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,聽YupooResult.</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">);<br />聽聽聽聽聽聽聽聽stream.useAttributeFor(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">page</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,聽Integer.</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">);<br />聽聽聽聽聽聽聽聽stream.useAttributeFor(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">pages</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,聽Integer.</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">);<br />聽聽聽聽聽聽聽聽stream.useAttributeFor(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">perpage</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,聽Integer.</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">);<br />聽聽聽聽聽聽聽聽stream.useAttributeFor(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">total</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,聽Integer.</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">);<br />聽聽聽聽聽聽聽聽stream.alias(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">photo</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,聽YupooPhoto.</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">);<br />聽聽聽聽聽聽聽聽stream.useAttributeFor(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">id</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,聽String.</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">);<br />聽聽聽聽聽聽聽聽stream.useAttributeFor(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">owner</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,聽String.</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">);<br />聽聽聽聽聽聽聽聽stream.useAttributeFor(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">title</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,聽String.</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">);<br />聽聽聽聽聽聽聽聽stream.useAttributeFor(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">host</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,聽String.</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">);<br />聽聽聽聽聽聽聽聽stream.useAttributeFor(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">dir</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,聽String.</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">);<br />聽聽聽聽聽聽聽聽stream.useAttributeFor(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">filename</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">,聽String.</span><span style="color: rgb(0, 0, 255);">class</span><span style="color: rgb(0, 0, 0);">);</span></div><a target="_blank"><br /><img alt="鍒涢犲叡鐢ㄥ崗璁?緗插悕,闈炲晢涓?淇濇寔涓鑷? src="http://leaf.jdk.cn/rights.gif" border="0" height="31" width="88" /></a>聽聽 闄ょ粡鐗瑰埆娉ㄦ槑澶?鏈枃绔犵増鏉冨綊<strong><a class="" ><font color="#6b6b52">鑾娉℃場</font></a></strong>鎵鏈? <br /><font color="#ff0000">緗插悕,闈炲晢涓氱敤閫?淇濇寔涓鑷?</font>聽聽聽<a title="鑾娉℃場" target="_blank">somebody(鑾)</a><img src ="http://m.tkk7.com/rory/aggbug/94475.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/rory/" target="_blank">鑾</a> 2007-01-17 18:24 <a href="http://m.tkk7.com/rory/archive/2007/01/17/howto-dealwith-xstream-xmlnode-attribute.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍙堟槸涔辯爜闂-Filter 閰嶇疆涔熷緢閲嶈http://m.tkk7.com/rory/archive/2006/12/27/character_encoding_problem_filtermapping_position.html鑾鑾Wed, 27 Dec 2006 02:37:00 GMThttp://m.tkk7.com/rory/archive/2006/12/27/character_encoding_problem_filtermapping_position.htmlhttp://m.tkk7.com/rory/comments/90236.htmlhttp://m.tkk7.com/rory/archive/2006/12/27/character_encoding_problem_filtermapping_position.html#Feedback3http://m.tkk7.com/rory/comments/commentRss/90236.htmlhttp://m.tkk7.com/rory/services/trackbacks/90236.html聽 涓婂懆鏇存柊浜嗕竴涓媘yblog,娣誨姞浜嗕竴涓狥ilter錛屽仛緇熻璁塊棶鐢ㄣ傚彲鏄悗鏉ュ彂鐜板嚭鐜頒貢鐮侀棶棰樹簡銆傛壘浜嗗緢涔呴兘娌℃湁鎵懼埌闂銆俤ebug鐨勬椂鍊欑湅鍒?CharacterEncodingFilter紜疄鏄墽琛屼簡銆備笉榪囧氨鏄病鏈夋晥鏋溿傛墽琛屼箣鍓嶆槸ISO-8859-1緙栫爜鐨勶紝鎵ц涔嬪悗榪樻槸錛?CharacterEncodingFilter灝辨病鏈夎搗鍒頒綔鐢ㄣ傚悗鏉ョ粓浜庢壘鍒伴棶棰樼殑鍘熷洜浜嗐傚師鏉ユ槸Filter閰嶇疆鍏堝悗欏哄簭鐨勫師鍥犮?br />聽聽聽聽聽聽 鍒氬紑濮嬬殑閰嶇疆鏄繖鏍風殑:

聽聽聽聽 < filter-mapping >
聽聽聽聽聽聽聽聽
< filter-name > requestCounterFilter </ filter-name >
聽聽聽聽聽聽聽聽
< url-pattern > *.jhtml </ url-pattern >
聽聽聽聽
</ filter-mapping >
聽聽
聽聽聽聽
< filter-mapping >
聽聽聽聽聽聽聽聽
< filter-name > encodingFilter </ filter-name >
聽聽聽聽聽聽聽聽
< url-pattern > /dwr/* </ url-pattern >
聽聽聽聽
</ filter-mapping >
聽聽聽聽
聽聽聽聽
< filter-mapping >
聽聽聽聽聽聽聽聽
< filter-name > encodingFilter </ filter-name >
聽聽聽聽聽聽聽聽
< url-pattern > *.jhtml </ url-pattern >
聽聽聽聽
</ filter-mapping >
聽聽聽聽
聽聽聽聽
< filter-mapping >
聽聽聽聽聽聽聽聽
< filter-name > encodingFilter </ filter-name >
聽聽聽聽聽聽聽聽
< url-pattern > *.jsp </ url-pattern >
聽聽聽聽
</ filter-mapping >

聽 鍏堢粡榪囬偅涓粺璁$殑filter鐒跺悗鍐嶇粡榪囩紪鐮佺殑filter銆傝繖鏍風殑璇濈紪鐮佺殑filter灝變笉璧蜂綔鐢ㄤ簡銆傚彧瑕佸惂緙栫爜鐨刦ilter鏀懼埌鏈鍓嶉潰灝辨病鏈夐棶棰樹簡銆傛敼鎴愯繖鏍峰氨濂姐?br />

聽聽聽聽 < filter-mapping >
聽聽聽聽聽聽聽聽
< filter-name > encodingFilter </ filter-name >
聽聽聽聽聽聽聽聽
< url-pattern > /dwr/* </ url-pattern >
聽聽聽聽
</ filter-mapping >
聽聽聽聽
聽聽聽聽
< filter-mapping >
聽聽聽聽聽聽聽聽
< filter-name > encodingFilter </ filter-name >
聽聽聽聽聽聽聽聽
< url-pattern > *.jhtml </ url-pattern >
聽聽聽聽
</ filter-mapping >
聽聽聽聽
聽聽聽聽
< filter-mapping >
聽聽聽聽聽聽聽聽
< filter-name > encodingFilter </ filter-name >
聽聽聽聽聽聽聽聽
< url-pattern > *.jsp </ url-pattern >
聽聽聽聽
</ filter-mapping >
聽聽聽聽
聽聽聽聽
< filter-mapping >
聽聽聽聽聽聽聽聽
< filter-name > requestCounterFilter </ filter-name >
聽聽聽聽聽聽聽聽
< url-pattern > *.jhtml </ url-pattern >
聽聽聽聽
</ filter-mapping >


浠ュ悗澶у涓瀹氳娉ㄦ剰鍟娿傞『搴忛棶棰樹篃鏄緢閲嶈鐨勩?br />鍒涢犲叡鐢ㄥ崗璁?緗插悕,闈炲晢涓?淇濇寔涓鑷? src=聽聽 闄ょ粡鐗瑰埆娉ㄦ槑澶?鏈枃绔犵増鏉冨綊鑾娉℃場鎵鏈?
緗插悕,闈炲晢涓氱敤閫?淇濇寔涓鑷?聽聽聽somebody(鑾)



鑾 2006-12-27 10:37 鍙戣〃璇勮
]]>
tuckey urlrewrite 3.x鐨勯棶棰?/title><link>http://m.tkk7.com/rory/archive/2006/12/12/tuckey-urlrewrite_3-querystring-problem.html</link><dc:creator>鑾</dc:creator><author>鑾</author><pubDate>Tue, 12 Dec 2006 02:33:00 GMT</pubDate><guid>http://m.tkk7.com/rory/archive/2006/12/12/tuckey-urlrewrite_3-querystring-problem.html</guid><wfw:comment>http://m.tkk7.com/rory/comments/87151.html</wfw:comment><comments>http://m.tkk7.com/rory/archive/2006/12/12/tuckey-urlrewrite_3-querystring-problem.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/rory/comments/commentRss/87151.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/rory/services/trackbacks/87151.html</trackback:ping><description><![CDATA[鏄ㄥぉ鏅氫笂閰嶇疆myblog鐨剅ewrite銆傚彂鐜頒竴涓鎬殑闂銆傜敱浜庣幇鍦ㄤ嬌鐢ㄧ殑榪欎釜pjblog錛屼負浜嗚鎼滅儲寮曟搸鏀跺綍鐨勮繛鎺ユ湁鏁堛傛垜鎯蟲妸鍘熸潵鐨刟sp榪炴帴rewrite鍒版垜鐨勬柊紼嬪簭涓婇潰銆傛墍浠ユ湁榪欐牱涓鏉¤鍒欍?br /><br /><div style="BORDER-RIGHT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: rgb(204,204,204) 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: rgb(204,204,204) 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BACKGROUND-COLOR: rgb(238,238,238)"><span style="COLOR: rgb(0,0,0)">聽聽聽聽</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)">from</span><span style="COLOR: rgb(0,0,255)">></span><span style="COLOR: rgb(0,0,0)">^/article.asp\?id=(.*)$</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(255,0,0)">type</span><span style="COLOR: rgb(0,0,255)">="redirect"</span><span style="COLOR: rgb(0,0,255)">></span><span style="COLOR: rgb(0,0,0)">/entry/$1.jhtml</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>聽聽聽聽 浣嗘槸鎴戣繖鏍風殑榪炴帴鎬繪槸鍖歸厤涓嶅埌錛屽彧瑕佸幓鎺夐偅涓紵灝卞彲浠ヤ簡銆傝繖涓鍒欒〃杈懼紡鏄病鏈夐棶棰樼殑銆?article.asp?id=64鏄彲浠ュ尮閰嶇殑鍒扮殑銆?br />聽聽聽 鍚庢潵鐪?.0鐨刴anual (http://tuckey.org/urlrewrite/manual/3.0/)鎵嶅彂鐜板師鏉ユ槸榪欎釜鐨勯棶棰樸?br /><h3><urlrewrite> element</h3><p>The top level element.</p><table cellspacing="0"><tbody><tr><th>Attribute</th><th>Possible Value</th><th>Explanation</th></tr><tr><td rowspan="2">default-match-type <br /><small>(optional)</small></td><td><b>regex</b> (default)</td><td>All rules and thier conditions will be processed using the Java Regular Expression engine (unless <code>match-type</code> is specified on a rule).</td></tr><tr><td>wildcard</td><td>All rules and thier conditions will be processed using the <a >Wildcard Expression engine</a> (unless <code>match-type</code> is specified on a rule).</td></tr><tr><td rowspan="3">decode-using <br /><small>(optional)</small></td><td><b>utf8</b> (default)</td><td>When URL is decoded UTF-8 will be used.</td></tr><tr><td>null</td><td>Do not decode.</td></tr><tr><td>[encoding]</td><td>Any string representing a supported character encoding eg, ISO-8859-1. See <a >Java Charset Object</a> for more info. </td></tr><tr><td style="FONT-WEIGHT: bold; COLOR: rgb(0,0,255)" rowspan="2">use-query-string <br /><small>(optional)</small></td><td><b>false</b> (default)</td><td>The query string will <em>not</em> be appended to the url that the "from" element matches against.</td></tr><tr><td>true</td><td>The query string will be appended to the url that the "from" element matches against.</td></tr><tr><td rowspan="2">use-context <br /><small>(optional)</small></td><td><b>false</b> (default)</td><td>The context path will <em>not</em> be added to the url that the "from" element matches against.</td></tr><tr><td>true</td><td>The context path will be added to the url that the "from" element matches against.</td></tr></tbody></table><br />灝辨槸閭d釜use-query-string 鐨勯棶棰橈紝榛樿鐨勬槸涓嶄嬌鐢╭uery-string灝辨槸鎶?鍚庨潰鐨勯兘蹇界暐浜嗐傛墍浠ュ氨涓嶈兘鍖歸厤鍒頒簡銆傚彧瑕佸湪<urlrewrite>閲岄潰鍔犱竴涓睘鎬у氨鍙互浜嗐?br /><div style="BORDER-RIGHT: rgb(204,204,204) 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: rgb(204,204,204) 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: rgb(204,204,204) 1px solid; WIDTH: 98%; PADDING-TOP: 4px; BORDER-BOTTOM: rgb(204,204,204) 1px solid; BACKGROUND-COLOR: rgb(238,238,238)"><span style="COLOR: rgb(0,0,255)"><</span><span style="COLOR: rgb(128,0,0)">urlrewrite聽</span><span style="COLOR: rgb(255,0,0)">use-query-string</span><span style="COLOR: rgb(0,0,255)">="true"</span><span style="COLOR: rgb(0,0,255)">></span><span style="COLOR: rgb(0,0,0)"><br />聽聽聽聽<img alt="" src="http://m.tkk7.com/images/dot.gif" /><br /></span><span style="COLOR: rgb(0,0,255)"></</span><span style="COLOR: rgb(128,0,0)">urlrewrite</span><span style="COLOR: rgb(0,0,255)">></span></div><p><a target="_blank"><img height="31" alt="鍒涢犲叡鐢ㄥ崗璁?緗插悕,闈炲晢涓?淇濇寔涓鑷? src="http://leaf.jdk.cn/rights.gif" width="88" border="0" /></a>聽聽 闄ょ粡鐗瑰埆娉ㄦ槑澶?鏈枃绔犵増鏉冨綊<strong><a class="" ><font color="#6b6b52">鑾娉℃場</font></a></strong>鎵鏈? <br /><font color="#ff0000">緗插悕,闈炲晢涓氱敤閫?淇濇寔涓鑷?</font>聽聽聽<a title="鑾娉℃場" target="_blank">somebody(鑾)</a></p><img src ="http://m.tkk7.com/rory/aggbug/87151.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/rory/" target="_blank">鑾</a> 2006-12-12 10:33 <a href="http://m.tkk7.com/rory/archive/2006/12/12/tuckey-urlrewrite_3-querystring-problem.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>榪樻槸涔辯爜闂http://m.tkk7.com/rory/archive/2006/07/22/59567.html鑾鑾Sat, 22 Jul 2006 10:13:00 GMThttp://m.tkk7.com/rory/archive/2006/07/22/59567.htmlhttp://m.tkk7.com/rory/comments/59567.htmlhttp://m.tkk7.com/rory/archive/2006/07/22/59567.html#Feedback2http://m.tkk7.com/rory/comments/commentRss/59567.htmlhttp://m.tkk7.com/rory/services/trackbacks/59567.html聽聽聽聽 铏界劧欏圭洰鍏ㄩ儴閲囩敤浜哢TF-8緙栫爜錛屾墍鏈夌殑婧愭枃浠?.java,*.jsc,*.html,*.ftl閮介噰鐢ㄤ簡UTF-8緙栫爜銆傚彲鏄繕鏄嚭鐜頒簡涔辯爜闂銆傚緢鏄笉鐖斤紝鍚庢潵鎵懼埌浜唗omcat錛屽拰resin鐨勯厤緗?/p>
  1. Tomcat鐨勯厤緗?conf/server.xml)
    聽聽聽聽<!--聽Define聽a聽non-SSL聽HTTP/1.1聽Connector聽on聽port聽8080聽-->
    聽聽聽聽
    <Connector聽port="80"聽maxHttpHeaderSize="8192"
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽maxThreads
    ="150"聽minSpareThreads="25"聽maxSpareThreads="75"
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽enableLookups
    ="false"聽redirectPort="8443"聽acceptCount="100"
    聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽connectionTimeout
    ="20000"聽disableUploadTimeout="true"聽URIEncoding="UTF-8"/>
  2. Resin鐨勯厤緗?conf/resin.conf)

    character-encoding

    Resin 1.1
    child of: resin, server, host-default, host, web-app-default, web-app
    default: The default value is ISO-8859-1.

    Specifies the default character encoding for the environment.

    <web-app id='/'>
      <character-encoding>shift_jis</character-encoding>
      ...
    
    </web-app>
    

聽聽聽聽 榪欎釜鏄痳esin doc閲岄潰鐨勬垜鏄湪web-app-default閲岄潰鍔犱笂浜唀ncoding鐨勯厤緗?/p>

聽聽聽聽 < web-app-default >
聽聽聽聽聽聽
< character-encoding > UTF-8 </ character-encoding >
聽聽聽聽聽聽
聽聽聽聽
</ web-app-default >

甯屾湜瀵逛綘鐨勯」鐩湁甯姪銆?/p>

鍒涢犲叡鐢ㄥ崗璁?緗插悕,闈炲晢涓?淇濇寔涓鑷? src= 聽聽 闄ょ粡鐗瑰埆娉ㄦ槑澶?鏈枃绔犵増鏉冨綊鑾娉℃場鎵鏈?
緗插悕,闈炲晢涓氱敤閫?淇濇寔涓鑷?聽聽聽somebody(鑾)聽聽



鑾 2006-07-22 18:13 鍙戣〃璇勮
]]>
鍏充簬Resin铏氭嫙鐩綍閰嶇疆鐨勯棶棰?/title><link>http://m.tkk7.com/rory/archive/2006/07/18/58838.html</link><dc:creator>鑾</dc:creator><author>鑾</author><pubDate>Tue, 18 Jul 2006 11:41:00 GMT</pubDate><guid>http://m.tkk7.com/rory/archive/2006/07/18/58838.html</guid><wfw:comment>http://m.tkk7.com/rory/comments/58838.html</wfw:comment><comments>http://m.tkk7.com/rory/archive/2006/07/18/58838.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/rory/comments/commentRss/58838.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/rory/services/trackbacks/58838.html</trackback:ping><description><![CDATA[欏圭洰涓涓」鐩渶瑕佸悓鏃跺紩鐢ㄤ竴涓潤鎬佽祫婧愶紝鎵浠ュ氨鎯沖埌閰嶇疆涓嶅悓鐨勮櫄鎷熺洰褰曟寚鍒板悓涓涓洰褰曘備簬鏄湁涓嬮潰鐨勯厤緗?<br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #000000">聽聽聽聽</span><span style="COLOR: #008000"><!--</span><span style="COLOR: #008000">聽configures聽the聽default聽host,聽matching聽any聽host聽name聽</span><span style="COLOR: #008000">--></span><span style="COLOR: #000000"><br />聽聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">host聽</span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">=""</span><span style="COLOR: #ff0000">聽root-directory</span><span style="COLOR: #0000ff">="."</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br />聽聽聽聽聽聽</span><span style="COLOR: #008000"><!--</span><span style="COLOR: #008000"><br />聽聽聽聽聽聽聽聽聽-聽configures聽an聽explicit聽root聽web-app聽matching聽the<br />聽聽聽聽聽聽聽聽聽-聽webapp's聽ROOT<br />聽聽聽聽聽聽聽聽</span><span style="COLOR: #008000">--></span><span style="COLOR: #000000"><br />聽聽聽聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">web-app聽</span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="/"</span><span style="COLOR: #ff0000">聽document-directory</span><span style="COLOR: #0000ff">="webapps/ROOT"</span><span style="COLOR: #0000ff">/></span><span style="COLOR: #000000"><br />聽聽聽聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">web-app聽</span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="/community/jsvm2"</span><span style="COLOR: #ff0000">聽document-directory</span><span style="COLOR: #0000ff">="D:\\projects\\FelooComponents\\jsvm2"</span><span style="COLOR: #0000ff">/></span><span style="COLOR: #000000"><br />聽聽聽聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">web-app聽</span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="/passport/jsvm2"</span><span style="COLOR: #ff0000">聽document-directory</span><span style="COLOR: #0000ff">="D:\\projects\\FelooComponents\\jsvm2"</span><span style="COLOR: #0000ff">/></span><span style="COLOR: #000000"><br />聽聽聽聽</span><span style="COLOR: #0000ff"></</span><span style="COLOR: #800000">host</span><span style="COLOR: #0000ff">></span></div><p>聽聽聽聽聽聽 浣嗘槸鍙戠幇榪欐牱鍙湁鍚庨潰涓涓鐢?<a href="http://localhost:8080/passport/jsvm2">http://localhost:8080/passport/jsvm2</a>)榪欎釜鏄彲浠?鍙槸(<a href="http://localhost:8080/community/jsvm2">http://localhost:8080/community/jsvm2</a>)灝變笉琛?寰堟槸閮侀椃銆傚彧瑕佸悗闈㈢殑document-directory涓嶆槸鍚屼竴涓洰褰曞氨鎴愩?br />聽聽聽聽聽聽 鍚庢潵鍦╮esin鐨刣oc閲岄潰鐪嬪埌path鐨勯厤緗?/p><h4>path-mapping</h4><div id="ntjxjlt" class="desc"><b>child of:</b> web-app-default, web-app<br /><p>Maps url patterns to real paths. If using a server like IIS, you may need to match the server's path aliases.</p><p></p><table class="deftable" cellspacing="0" cellpadding="2" width="90%" border="1"><tbody><tr><th>Attribute</th><th>Meaning</th><th>default</th></tr><tr><td><span id="lfrbvlb" class="meta">url-pattern</span></td><td>A pattern matching the url: <span id="fzndzpf" class="meta">/foo/*</span>, <span id="xblpjpp" class="meta">/foo</span>, or <span id="vfztndl" class="meta">*.foo</span></td></tr><tr><td>url-regexp</td><td>A regular expression matching the url </td></tr><tr><td>real-path</td><td>The prefix of the real path. When used with <span id="tdndxtt" class="meta">url-regexp</span>, allows substitution variables like <span id="nzrhdbj" class="meta">$1</span>. </td></tr></tbody></table><p></p><table class="egpad" cellspacing="0" width="90%"><tbody><tr><td class="example" bgcolor="#ffeecc"><pre><web-app id='/'> <path-mapping url-pattern='/resin/*' real-path='e:\resin'/> <path-mapping url-regexp='/~([^/]*)' real-path='e:\home$1'/> </web-app> </pre></td></tr></tbody></table></div><p>鏀規榪欐牱鐨勯厤緗氨ok浜嗐?/p><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><span style="COLOR: #000000">聽聽聽聽聽聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">web-app聽</span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="/community"</span><span style="COLOR: #ff0000">聽document-directory</span><span style="COLOR: #0000ff">="D:\\projects\\FelooCommunityWeb"</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br />聽聽聽聽聽聽聽聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">path-mapping聽</span><span style="COLOR: #ff0000">url-pattern</span><span style="COLOR: #0000ff">='jsvm2/*'<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="COLOR: #ff0000">real-path</span><span style="COLOR: #0000ff">='D:\\projects\\FelooComponents\\jsvm2'/><br />聽聽聽聽聽聽</span><span style="COLOR: #ff0000"></web-app</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br />聽聽聽聽聽聽<br />聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">web-app聽</span><span style="COLOR: #ff0000">id</span><span style="COLOR: #0000ff">="/passport"</span><span style="COLOR: #ff0000">聽document-directory</span><span style="COLOR: #0000ff">="D:\\projects\\FelooPassportWeb"</span><span style="COLOR: #0000ff">></span><span style="COLOR: #000000"><br />聽聽聽聽聽聽聽聽聽聽</span><span style="COLOR: #0000ff"><</span><span style="COLOR: #800000">path-mapping聽</span><span style="COLOR: #ff0000">url-pattern</span><span style="COLOR: #0000ff">='jsvm2/*'<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽</span><span style="COLOR: #ff0000">real-path</span><span style="COLOR: #0000ff">='D:\\projects\\FelooComponents\\jsvm2'/><br />聽聽聽聽聽聽</span><span style="COLOR: #ff0000"></web-app</span><span style="COLOR: #0000ff">></span></div><a target="_blank"><img height="31" alt="鍒涢犲叡鐢ㄥ崗璁?緗插悕,闈炲晢涓?淇濇寔涓鑷? src="http://leaf.jdk.cn/rights.gif" width="88" border="0" /></a>聽聽 闄ょ粡鐗瑰埆娉ㄦ槑澶?鏈枃绔犵増鏉冨綊<strong><a class="" title="" target=""><font color="#6b6b52">鑾娉℃場</font></a></strong>鎵鏈? <br /><font color="#ff0000">緗插悕,闈炲晢涓氱敤閫?淇濇寔涓鑷?</font>聽聽聽somebody(鑾)<img src ="http://m.tkk7.com/rory/aggbug/58838.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/rory/" target="_blank">鑾</a> 2006-07-18 19:41 <a href="http://m.tkk7.com/rory/archive/2006/07/18/58838.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍏充簬Freemarker鐢熸垚闈欐佹枃浠剁殑闂http://m.tkk7.com/rory/archive/2006/06/21/54134.html鑾鑾Wed, 21 Jun 2006 02:46:00 GMThttp://m.tkk7.com/rory/archive/2006/06/21/54134.htmlhttp://m.tkk7.com/rory/comments/54134.htmlhttp://m.tkk7.com/rory/archive/2006/06/21/54134.html#Feedback0http://m.tkk7.com/rory/comments/commentRss/54134.htmlhttp://m.tkk7.com/rory/services/trackbacks/54134.html浣跨敤FreeMarker鐢熸垚Html闈欐佹枃浠?瀹炰緥)銆?br />聽聽聽聽聽 鍦ㄦ垜浠殑欏圭洰涓篃鐢ㄥ埌浜咶reemarker鐢熸垚闈欐佹枃浠躲備笉榪囪繖閲屾垜瑕佽鐨勬槸緙栫爜鐨勯棶棰樸傛垜浠殑欏圭洰浣跨敤鐨勯兘鏄疷TF-8緙栫爜錛屾垜鐩存帴浣跨敤 椋炰簯灝忎緺 鎻愪緵鐨勬柟娉曠敓鎴愮殑鏂囦歡鍦║TF-8緙栫爜涓嬪療鐪嬫槸涔辯爜錛岃孏BK姝e父(鍚庢潵鍙戠幇鍥犱負鎴戠敤鐨勪腑鏂囨搷浣滅郴緇熸墍浠ョ敤GBK鏌ョ湅姝e父)銆?br />聽聽聽聽聽 褰撶劧鎴戞妸Freemarker鐨勯厤緗兘鏀規垚浜哢TF-8錛屾垜鐨勬ā鐗堟枃浠朵篃鏄疷TF-8緙栫爜鐨勩備笅闈㈡槸鍘熸潵鐨勪唬鐮?br />
聽聽聽聽publicvoid聽setTemplatePath(Resource聽templatePath)聽{
聽聽聽聽聽聽聽聽
this.templatePath聽=聽templatePath;
聽聽聽聽聽聽聽聽
//璁劇疆freemarker鐨勫弬鏁?/span>
聽聽聽聽聽聽聽聽freemarkerCfg聽=new聽Configuration();
聽聽聽聽聽聽聽聽
try聽{
聽聽聽聽聽聽聽聽聽聽聽聽freemarkerCfg.setDirectoryForTemplateLoading(
this.templatePath.getFile());
聽聽聽聽聽聽聽聽聽聽聽聽freemarkerCfg.setObjectWrapper(
new聽DefaultObjectWrapper());
聽聽聽聽聽聽聽聽聽聽聽聽freemarkerCfg.setDefaultEncoding(
"UTF-8");
聽聽聽聽聽聽聽聽}聽
catch聽(IOException聽ex)聽{
聽聽聽聽聽聽聽聽聽聽聽聽
thrownew聽SystemException("No聽Directory聽found,please聽check聽you聽config.");
聽聽聽聽聽聽聽聽}
聽聽聽聽}
聽聽聽聽/**
聽聽聽聽聽*聽鐢熸垚闈欐佹枃浠?br />聽聽聽聽聽*聽
@param聽templateFileName聽妯$増鍚嶇Оeg:(biz/order.ftl)
聽聽聽聽聽*聽
@param聽propMap聽鐢ㄤ簬澶勭悊妯℃澘鐨勫睘鎬bject鏄犲皠聽
聽聽聽聽聽*聽
@param聽htmlFilePath聽瑕佺敓鎴愮殑闈欐佹枃浠剁殑璺緞,鐩稿璁劇疆涓殑鏍硅礬寰?渚嬪聽"/biz/2006/5/"聽
聽聽聽聽聽*聽
@param聽htmlFileName聽瑕佺敓鎴愮殑鏂囦歡鍚?渚嬪聽"123.htm"聽
聽聽聽聽聽*聽
@return
聽聽聽聽聽
*/
聽聽聽聽
privateboolean聽buildHtml(String聽templateFileName,Map聽propMap,聽String聽htmlFilePath,String聽htmlFileName){
聽聽聽聽聽聽聽聽
try聽{
聽聽聽聽聽聽聽聽聽聽聽聽Template聽template聽
=聽freemarkerCfg.getTemplate(templateFileName);
聽聽聽聽聽聽聽聽聽聽聽聽template.setEncoding(
"UTF-8");
聽聽聽聽聽聽聽聽聽聽聽聽
//鍒涘緩鐢熸垚鏂囦歡鐩綍
聽聽聽聽聽聽聽聽聽聽聽聽creatDirs(buildPath.getFilename(),htmlFilePath);
聽聽聽聽聽聽聽聽聽聽聽聽File聽htmlFile聽
=new聽File(buildPath聽+聽htmlFilePath聽+聽htmlFileName);
聽聽聽聽聽聽聽聽聽聽聽聽Writer聽out聽
=new聽BufferedWriter(new聽OutputStreamWriter(new聽FileOutputStream(htmlFile)));
聽聽聽聽聽聽聽聽聽聽聽聽template.process(propMap,out);
聽聽聽聽聽聽聽聽聽聽聽聽out.flush();
聽聽聽聽聽聽聽聽聽聽聽聽
returntrue;
聽聽聽聽聽聽聽聽}聽
catch聽(TemplateException聽ex){
聽聽聽聽聽聽聽聽聽聽聽聽log.error(
"Build聽Error"+templateFileName,ex);
聽聽聽聽聽聽聽聽聽聽聽聽
returnfalse;
聽聽聽聽聽聽聽聽}聽
catch聽(IOException聽e)聽{
聽聽聽聽聽聽聽聽聽聽聽聽log.error(
"Build聽Error"+templateFileName,e);
聽聽聽聽聽聽聽聽聽聽聽聽
returnfalse;
聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽
聽聽聽聽}
涓嬮潰鏄慨鏀逛箣鍚庣殑浠g爜
聽聽聽聽/**
聽聽聽聽聽*聽鐢熸垚闈欐佹枃浠?br />聽聽聽聽聽*聽
@param聽templateFileName聽妯$増鍚嶇Оeg:(biz/order.ftl)
聽聽聽聽聽*聽
@param聽propMap聽鐢ㄤ簬澶勭悊妯℃澘鐨勫睘鎬bject鏄犲皠聽
聽聽聽聽聽*聽
@param聽htmlFilePath聽瑕佺敓鎴愮殑闈欐佹枃浠剁殑璺緞,鐩稿璁劇疆涓殑鏍硅礬寰?渚嬪聽"/biz/2006/5/"聽
聽聽聽聽聽*聽
@param聽htmlFileName聽瑕佺敓鎴愮殑鏂囦歡鍚?渚嬪聽"123.htm"聽
聽聽聽聽聽*聽
@return
聽聽聽聽聽
*/
聽聽聽聽
privateboolean聽buildHtml(String聽templateFileName,Map聽propMap,聽String聽htmlFilePath,String聽htmlFileName){
聽聽聽聽聽聽聽聽
try聽{
聽聽聽聽聽聽聽聽聽聽聽聽Template聽template聽
=聽freemarkerCfg.getTemplate(templateFileName);
聽聽聽聽聽聽聽聽聽聽聽聽template.setEncoding(
"UTF-8");
聽聽聽聽聽聽聽聽聽聽聽聽
//鍒涘緩鐢熸垚鏂囦歡鐩綍
聽聽聽聽聽聽聽聽聽聽聽聽creatDirs(buildPath.getFilename(),htmlFilePath);
聽聽聽聽聽聽聽聽聽聽聽聽File聽htmlFile聽
=new聽File(buildPath聽+聽htmlFilePath聽+聽htmlFileName);
聽聽聽聽聽聽聽聽聽聽聽聽Writer聽out聽
=new聽BufferedWriter(new聽OutputStreamWriter(new聽FileOutputStream(htmlFile),"UTF-8"));
聽聽聽聽聽聽聽聽聽聽聽聽template.process(propMap,out);
聽聽聽聽聽聽聽聽聽聽聽聽out.flush();
聽聽聽聽聽聽聽聽聽聽聽聽
returntrue;
聽聽聽聽聽聽聽聽}聽
catch聽(TemplateException聽ex){
聽聽聽聽聽聽聽聽聽聽聽聽log.error(
"Build聽Error"+templateFileName,ex);
聽聽聽聽聽聽聽聽聽聽聽聽
returnfalse;
聽聽聽聽聽聽聽聽}聽
catch聽(IOException聽e)聽{
聽聽聽聽聽聽聽聽聽聽聽聽log.error(
"Build聽Error"+templateFileName,e);
聽聽聽聽聽聽聽聽聽聽聽聽
returnfalse;
聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽
聽聽聽聽}
鍘熷洜灝卞湪浜嶰utputStreamWriter鐨勪笉鍚屾瀯閫犳柟娉?br />
OutputStreamWriter(OutputStream聽out)
聽聽聽聽聽聽聽聽聽聽鍒涘緩浣跨敤榛樿瀛楃緙栫爜鐨?OutputStreamWriter銆?br />
OutputStreamWriter(OutputStream聽out, String聽charsetName)
聽聽聽聽聽聽聽聽聽聽鍒涘緩浣跨敤鎸囧畾瀛楃闆嗙殑 OutputStreamWriter銆?br />
榪欎釜鏄腑鏂嘕DK鐨勬枃妗h鏄庯紝鍒氬紑濮嬫垜浣跨敤榛樿鐨勬瀯閫犲嚱鏁幫紝鎵浠ヤ嬌鐢ㄤ簡緋葷粺榛樿鐨勭紪鐮侊紝GBK錛屾墍浠ュ湪鐢熸垚闈欐佹枃浠剁殑鏃跺欐妸UTF-8鍐呭鐢℅BK緙栫爜鍐欏叆浜嗭紝鎵浠ュ湪UTF-8涓嬫祻瑙堝氨鏈夐棶棰樸?br />
榪樻湁鍏充簬淇敼妯$増鏂囦歡鍚屾牱涔熻娉ㄦ剰榪欎釜闂銆?br />
聽聽聽聽public聽String聽loadTemplate(String聽templateName)聽{
聽聽聽聽聽聽聽聽StringBuffer聽sb聽
=new聽StringBuffer();
聽聽聽聽聽聽聽聽
try聽{
聽聽聽聽聽聽聽聽聽聽聽聽File聽file聽
=new聽File(templatePath+"/"+templateName);
聽聽聽聽聽聽聽聽聽聽聽聽BufferedReader聽reader聽
=new聽BufferedReader(new聽InputStreamReader(new聽FileInputStream(file),"UTF-8"));
聽聽聽聽聽聽聽聽聽聽聽聽String聽line聽
=聽reader.readLine();
聽聽聽聽聽聽聽聽聽聽聽聽
while(line聽!=null)聽聽聽聽{
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽sb.append(line);
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽sb.append(
"\r\n");
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽line聽
=聽reader.readLine();
聽聽聽聽聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽聽聽聽聽reader.close();
聽聽聽聽聽聽聽聽}聽
catch聽(IOException聽e)聽{
聽聽聽聽聽聽聽聽聽聽聽聽
thrownew聽SystemException("Loading聽template聽Error:",e);
聽聽聽聽聽聽聽聽}
聽聽聽聽聽聽聽聽
return聽sb.toString();
聽聽聽聽}
聽聽聽聽publicvoid聽saveTemplate(String聽templateName,聽String聽templateContent)聽{
聽聽聽聽聽聽聽聽
try聽{
聽聽聽聽聽聽聽聽聽聽聽聽File聽file聽
=new聽File(templatePath聽+"/"+聽templateName);
聽聽聽聽聽聽聽聽聽聽聽聽Writer聽out聽
=new聽BufferedWriter(new聽OutputStreamWriter(new聽FileOutputStream(file),"UTF-8"));
聽聽聽聽聽聽聽聽聽聽聽聽out.write(templateContent);
聽聽聽聽聽聽聽聽聽聽聽聽out.flush();
聽聽聽聽聽聽聽聽聽聽聽聽
//鎵斿嚭templatesave浜嬩歡
聽聽聽聽聽聽聽聽聽聽聽聽TemplateSaveEvent聽evt聽=new聽TemplateSaveEvent();
聽聽聽聽聽聽聽聽聽聽聽聽evt.setTemplateName(templateName);
聽聽聽聽聽聽聽聽聽聽聽聽dispatchTemplateEvent(evt);
聽聽聽聽聽聽聽聽}聽
catch聽(IOException聽e)聽{
聽聽聽聽聽聽聽聽聽聽聽聽
thrownew聽SystemException("Write聽template聽Error",e);
聽聽聽聽聽聽聽聽}
聽聽聽聽}



鑾 2006-06-21 10:46 鍙戣〃璇勮
]]>
鐢╝nt榪涜欏圭洰鏃犲咖閮ㄧ講http://m.tkk7.com/rory/archive/2006/04/28/43884.html鑾鑾Fri, 28 Apr 2006 14:27:00 GMThttp://m.tkk7.com/rory/archive/2006/04/28/43884.htmlhttp://m.tkk7.com/rory/comments/43884.htmlhttp://m.tkk7.com/rory/archive/2006/04/28/43884.html#Feedback3http://m.tkk7.com/rory/comments/commentRss/43884.htmlhttp://m.tkk7.com/rory/services/trackbacks/43884.html聽聽聽 鍏充簬欏圭洰鐨勪竴涓厤緗垜鐨勫墠鍑犵瘒鏂囩珷鎴戜篃鎻愬埌榪囷紝閭d釜upload鐨勯棶棰樺氨涓嶄細鍙戠敓浜嗐傝繕鏈夊氨鏄叧浜庨」鐩紑鍙戜腑鐨勪竴浜涢棶棰樸傛瘮濡傛暟鎹簱鐨勮繛鎺ュ湴鍧錛寀pload directory鐨勯厤緗瓑錛岃繖浜涘湪鍥㈤槦涓殑姣忎釜浜洪兘鏄笉涓鏍風殑錛岄偅涔堝湪鍙戝竷鐨勬椂鍊欓兘瑕佹敼鎴愭湇鍔″櫒涓婄殑姝g‘閰嶇疆錛屽鏋滀竴涓湀閮ㄧ講涓嬈¤繖鍒版病鏈変粈涔堛備絾鏄儚鎴戜滑榪欐牱姣忓ぉ閮ㄧ講灝變笉鏄偅涔堣交鏉句簡銆傝屼笖濡傛灉涓鏃朵笉娉ㄦ剰寰堝鏄撻犳垚閰嶇疆鐨勪笉姝g‘銆傛墍浠ュ浜庡緢澶氶厤緗枃浠舵垜浠兘鏈変袱浠姐備竴浠芥槸鐢ㄦ埛鑷繁寮鍙戠敤鐨勶紝涓浠芥槸閮ㄧ講鍒版湇鍔″櫒鐨勯厤緗紝榪欐牱鍦ㄥ紑鍙戠殑鏃跺欏洟闃熶腑鐨勬瘡涓漢閮戒笉涓鏍鳳紝鍏充簬鏈嶅姟鍣ㄧ殑閰嶇疆閮芥槸涓鏍風殑錛屽湪鍙戝竷鐨勬椂鍊欐槸鐢ㄧ殑鏈嶅姟鍣ㄧ殑閰嶇疆鑰屼笉鏄敤寮鍙戠敤鐨勯厤緗俥g錛歸eb.xml(涓漢鐨勯厤緗?web-dest.xml 鑰屽叧閿殑閰嶇疆涔熷氨鏄笅闈㈣繖孌點?br />web.xml
聽聽聽聽<context-param>
聽聽聽聽聽聽聽聽
<param-name>contextConfigLocation</param-name>
聽聽聽聽聽聽聽聽
<param-value>
聽聽聽聽聽聽聽聽聽聽聽聽classpath:spring/*_context.xml,
聽聽聽聽聽聽聽聽聽聽聽聽classpath:spring/global.xml聽

聽聽聽聽聽聽聽聽
</param-value>
聽聽聽聽
</context-param>
web-dest.xml
聽聽聽聽<context-param>
聽聽聽聽聽聽聽聽
<param-name>contextConfigLocation</param-name>
聽聽聽聽聽聽聽聽
<param-value>
聽聽聽聽聽聽聽聽聽聽聽聽classpath:spring/*_context.xml,
聽聽聽聽聽聽聽聽聽聽聽聽classpath:spring/global-dest.xml,
聽聽聽聽聽聽聽聽聽聽聽聽classpath:spring/scheduler.xml
聽聽聽聽聽聽聽聽
</param-value>
聽聽聽聽
</context-param>
娉ㄦ剰鍒板叾涓笉涓鏍風殑銆俤est閲屽皯浜唖cheduler.xml榪欎釜涓昏鏄畾鏃舵墽琛岀殑涓浜涗換鍔★紝涓鑸湪寮鍙戠殑鏃跺欓兘涓嶉渶瑕侊紝鍘繪帀涔熷彲浠ユ彁鍗囬熷害錛屼篃涓嶄細鍑虹幇閭d箞澶氱殑log銆傝繕鏈夊氨鏄彂甯冪殑web.xml鐢ㄤ簡global-dest.xml榪欎釜鏄叧浜巗pring鐨勬葷殑閰嶇疆銆?br />global.xml
聽聽聽聽<bean聽id="dataSource"聽class="org.apache.commons.dbcp.BasicDataSource"聽destroy-method="close">
聽聽聽聽聽聽聽聽
<property聽name="driverClassName"><value>net.sourceforge.jtds.jdbc.Driver</value></property>
聽聽聽聽聽聽聽聽
<property聽name="url">
聽聽聽聽聽聽聽聽聽聽聽聽
<value>jdbc:jtds:sqlserver://192.168.0.240:1433/fivefortunes;SelectMethod=cursor</value>
聽聽聽聽聽聽聽聽聽聽聽聽
</property>
聽聽聽聽聽聽聽聽
<property聽name="username"><value>sa</value></property>
聽聽聽聽聽聽聽聽
<property聽name="password"><value></value></property>
聽聽聽聽
</bean>
聽聽聽聽
聽聽聽聽
<bean聽id="dataSource2"聽class="org.apache.commons.dbcp.BasicDataSource"聽destroy-method="close">
聽聽聽聽聽聽聽聽
<property聽name="driverClassName"><value>net.sourceforge.jtds.jdbc.Driver</value></property>
聽聽聽聽聽聽聽聽
<property聽name="url">
聽聽聽聽聽聽聽聽聽聽聽聽
<value>jdbc:jtds:sqlserver://192.168.0.240:1433/outmail;SelectMethod=cursor</value>
聽聽聽聽聽聽聽聽聽聽聽聽
</property>
聽聽聽聽聽聽聽聽
<property聽name="username"><value>sa</value></property>
聽聽聽聽聽聽聽聽
<property聽name="password"><value></value></property>
聽聽聽聽
</bean>
聽聽聽聽
聽聽聽聽
<bean聽id="customDataSource"聽class="org.apache.commons.dbcp.BasicDataSource"聽destroy-method="close">
聽聽聽聽聽聽聽聽
<property聽name="driverClassName"><value>net.sourceforge.jtds.jdbc.Driver</value></property>
聽聽聽聽聽聽聽聽
<property聽name="url">
聽聽聽聽聽聽聽聽聽聽聽聽
<value>jdbc:jtds:sqlserver://192.168.0.240:1433/custom;SelectMethod=cursor</value>
聽聽聽聽聽聽聽聽聽聽聽聽
</property>
聽聽聽聽聽聽聽聽
<property聽name="username"><value>sa</value></property>
聽聽聽聽聽聽聽聽
<property聽name="password"><value></value></property>
聽聽聽聽
</bean>
global-dest.xml
聽聽聽聽<bean聽id="dataSource"聽class="org.apache.commons.dbcp.BasicDataSource"聽destroy-method="close">
聽聽聽聽聽聽聽聽
<property聽name="driverClassName"><value>net.sourceforge.jtds.jdbc.Driver</value></property>
聽聽聽聽聽聽聽聽
<property聽name="url">
聽聽聽聽聽聽聽聽聽聽聽聽
<value>jdbc:jtds:sqlserver://192.168.0.5:1433/fivefortunes;SelectMethod=cursor</value>
聽聽聽聽聽聽聽聽聽聽聽聽
</property>
聽聽聽聽聽聽聽聽
<property聽name="username"><value>sa</value></property>
聽聽聽聽聽聽聽聽
<property聽name="password"><value></value></property>
聽聽聽聽
</bean>
聽聽聽聽
聽聽聽聽
<bean聽id="dataSource2"聽class="org.apache.commons.dbcp.BasicDataSource"聽destroy-method="close">
聽聽聽聽聽聽聽聽
<property聽name="driverClassName"><value>net.sourceforge.jtds.jdbc.Driver</value></property>
聽聽聽聽聽聽聽聽
<property聽name="url">
聽聽聽聽聽聽聽聽聽聽聽聽
<value>jdbc:jtds:sqlserver://192.168.0.5:1433/outmail;SelectMethod=cursor</value>
聽聽聽聽聽聽聽聽聽聽聽聽
</property>
聽聽聽聽聽聽聽聽
<property聽name="username"><value>sa</value></property>
聽聽聽聽聽聽聽聽
<property聽name="password"><value></value></property>
聽聽聽聽
</bean>
聽聽聽聽
聽聽聽聽
<bean聽id="customDataSource"聽class="org.apache.commons.dbcp.BasicDataSource"聽destroy-method="close">
聽聽聽聽聽聽聽聽
<property聽name="driverClassName"><value>net.sourceforge.jtds.jdbc.Driver</value></property>
聽聽聽聽聽聽聽聽
<property聽name="url">
聽聽聽聽聽聽聽聽聽聽聽聽
<value>jdbc:jtds:sqlserver://192.168.0.5:1433/custom;SelectMethod=cursor</value>
聽聽聽聽聽聽聽聽聽聽聽聽
</property>
聽聽聽聽聽聽聽聽
<property聽name="username"><value>sa</value></property>
聽聽聽聽聽聽聽聽
<property聽name="password"><value></value></property>
聽聽聽聽
</bean>
榪樻湁鍏充簬涓浜沺roperties鏂囦歡鎴戜滑閲囩敤浜嗙敤ant閮ㄧ講鐨勬椂鍊欐敼鍚嶅瓧鏉ヨ揪鍒扮洰鐨勩?br />build.xml
聽聽聽聽聽聽聽聽<move聽file="${dist.dir}/mail.properties"聽tofile="${dist.dir}/mail-dev.properties"/>
聽聽聽聽聽聽聽聽
<copy聽file="${dist.dir}/mail-dest.properties"聽tofile="${dist.dir}/mail.properties"/>
聽聽聽聽聽聽聽聽
<move聽file="${dist.dir}/upload.properties"聽tofile="${dist.dir}/upload-dev.properties"/>
聽聽聽聽聽聽聽聽
<copy聽file="${dist.dir}/upload-dest.properties"聽tofile="${dist.dir}/upload.properties"/>

榪欎釜鏄湪war涔嬪墠鍋氱殑錛屽ぇ瀹剁溂鐪嬩篃灝辨槑鐧藉惂錛屽氨鏄妸xx-dest.properties,鏀瑰悕鎴恱x.propeties銆傚湪鎵撳畬鍖呬箣鍚?br />
聽聽聽聽聽聽聽聽<move聽file="${dist.dir}/mail-dev.properties"聽tofile="${dist.dir}/mail.properties"/>
聽聽聽聽聽聽聽聽
<move聽file="${dist.dir}/upload-dev.properties"聽tofile="${dist.dir}/upload.properties"/>
榪欐牱灝辮揪鍒頒簡鎴戜滑鏃犲咖鐨勭洰鐨勪簡銆傚彧瑕佹瘡澶╅儴緗茬殑鏃跺欎繚璇佺▼搴忚兘姝e父榪愯錛宎nt war涓涓嬪氨瀹夊績閮ㄧ講鍚с?br />浠ヤ笂灝辨槸鍏ㄩ儴鍐呭錛屽鏋滄湁浠涔堜笉姝g‘嬈㈣繋鐮告澘鐮栥?img src ="http://m.tkk7.com/rory/aggbug/43884.html" width = "1" height = "1" />

鑾 2006-04-28 22:27 鍙戣〃璇勮
]]>
鍒氭墠鎶奵aucho鐨剋iki寮勫潖浜?/title><link>http://m.tkk7.com/rory/archive/2006/03/21/36572.html</link><dc:creator>鑾</dc:creator><author>鑾</author><pubDate>Tue, 21 Mar 2006 02:48:00 GMT</pubDate><guid>http://m.tkk7.com/rory/archive/2006/03/21/36572.html</guid><wfw:comment>http://m.tkk7.com/rory/comments/36572.html</wfw:comment><comments>http://m.tkk7.com/rory/archive/2006/03/21/36572.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/rory/comments/commentRss/36572.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/rory/services/trackbacks/36572.html</trackback:ping><description><![CDATA[<p> <a >http://wiki.caucho.com</a> <br />鐪熸槸涓嶅ソ鎰忔濄傛垜鍘繪敞鍐屼簡涓涓嬨傚彲鑳芥槸涓枃鏄電О鐨勯棶棰樺惂銆?br />nickname鎴戠敤浜嗐備腑鏂囥?/p> <p>瀹冩槸鐢ㄧ殑MediaWiki<br /><br /><a >http://leaf.jdk.cn/index.php/archives/82</a></p><img src ="http://m.tkk7.com/rory/aggbug/36572.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/rory/" target="_blank">鑾</a> 2006-03-21 10:48 <a href="http://m.tkk7.com/rory/archive/2006/03/21/36572.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://m.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> 主站蜘蛛池模板: <a href="http://directzx.com" target="_blank">精品亚洲成a人片在线观看少妇</a>| <a href="http://35469642.com" target="_blank">免费va在线观看</a>| <a href="http://cuuka.com" target="_blank">亚洲国产成人精品无码区在线观看</a>| <a href="http://moushengguigz.com" target="_blank">国产亚洲精品成人久久网站</a>| <a href="http://jinmenonline.com" target="_blank">成人毛片18岁女人毛片免费看</a>| <a href="http://wwwseselu.com" target="_blank">亚洲人成黄网在线观看</a>| <a href="http://kan63.com" target="_blank">av无码久久久久不卡免费网站</a>| <a href="http://55xxb.com" target="_blank">亚洲毛片一级带毛片基地</a>| <a href="http://7766qq.com" target="_blank">免费观看激色视频网站(性色) </a>| <a href="http://www77714.com" target="_blank">99re在线免费视频</a>| <a href="http://bomilon.com" target="_blank">亚洲系列中文字幕</a>| <a href="http://276194.com" target="_blank">无码国产精品久久一区免费</a>| <a href="http://xjyzz.com" target="_blank">亚洲偷偷自拍高清</a>| <a href="http://yisousou.com" target="_blank">日本一道综合久久aⅴ免费</a>| <a href="http://yy1514.com" target="_blank">色网站在线免费观看</a>| <a href="http://yy6636.com" target="_blank">国产专区一va亚洲v天堂</a>| <a href="http://by23336.com" target="_blank">99久久精品毛片免费播放</a>| <a href="http://zgfxshop.com" target="_blank">久久精品国产精品亚洲蜜月</a>| <a href="http://zkqzdq.com" target="_blank">**毛片免费观看久久精品</a>| <a href="http://mm1131.com" target="_blank">亚洲中文字幕无码一去台湾</a>| <a href="http://ksdhao.com" target="_blank">国产麻豆剧传媒精品国产免费</a>| <a href="http://783944.com" target="_blank">美女视频黄视大全视频免费的</a>| <a href="http://djllgs.com" target="_blank">亚洲人成网站在线观看青青</a>| <a href="http://microston.com" target="_blank">国产午夜无码精品免费看动漫</a>| <a href="http://chinahongfeng.com" target="_blank">91亚洲国产在人线播放午夜</a>| <a href="http://njchxf.com" target="_blank">97无码免费人妻超级碰碰夜夜</a>| <a href="http://heifengmi.com" target="_blank">在线观看亚洲免费视频</a>| <a href="http://www-959kj.com" target="_blank">黑人大战亚洲人精品一区</a>| <a href="http://jiggybaby.com" target="_blank">性xxxx视频免费播放直播</a>| <a href="http://bobostrong31.com" target="_blank">亚洲人成人网毛片在线播放</a>| <a href="http://blblkj.com" target="_blank">国产成人免费片在线视频观看</a>| <a href="http://6006769.com" target="_blank">精品一区二区三区高清免费观看</a>| <a href="http://hidiaoyan.com" target="_blank">亚洲免费在线播放</a>| <a href="http://5g6z.com" target="_blank">日韩在线免费看网站</a>| <a href="http://zhuoyueyc.com" target="_blank">拍拍拍无挡视频免费观看1000</a>| <a href="http://huakangweicai.com" target="_blank">亚洲综合一区二区</a>| <a href="http://dazngt.com" target="_blank">亚洲一级特黄无码片</a>| <a href="http://42329c.com" target="_blank">免费观看无遮挡www的视频</a>| <a href="http://91ttvv.com" target="_blank">曰批免费视频播放在线看片二 </a>| <a href="http://wwwv27.com" target="_blank">国产无遮挡无码视频免费软件</a>| <a href="http://5shitou.com" target="_blank">亚洲av日韩av综合</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>