﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-追随Java-随笔分类-WebWork</title><link>http://www.blogjava.net/hgq0011/category/2988.html</link><description>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;简单的事情重复做，就会产生累积效应！&lt;br/&gt;
&amp;nbsp;&amp;nbsp;
&lt;a href="http://www.fastonlineusers.com"&gt;&lt;b&gt;&lt;font color=red&gt;共有&lt;script src=http://fastonlineusers.com/online.php?d=hgq0011.blogjava.net&gt;&lt;/script&gt;人在同时阅读此Blog&lt;/font&gt;&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;</description><language>zh-cn</language><lastBuildDate>Wed, 28 Feb 2007 07:56:48 GMT</lastBuildDate><pubDate>Wed, 28 Feb 2007 07:56:48 GMT</pubDate><ttl>60</ttl><item><title>UTF-8 字符处理在 Web 开发中的应用</title><link>http://www.blogjava.net/hgq0011/archive/2006/07/31/60936.html</link><dc:creator>Harryson</dc:creator><author>Harryson</author><pubDate>Mon, 31 Jul 2006 01:37:00 GMT</pubDate><guid>http://www.blogjava.net/hgq0011/archive/2006/07/31/60936.html</guid><wfw:comment>http://www.blogjava.net/hgq0011/comments/60936.html</wfw:comment><comments>http://www.blogjava.net/hgq0011/archive/2006/07/31/60936.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hgq0011/comments/commentRss/60936.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hgq0011/services/trackbacks/60936.html</trackback:ping><description><![CDATA[
		<h1>
				<font size="3"> 上星期周五去面试的时候考官就问了我一个问题--关于web应用中的中文处理 ,下面的文章应该有点帮助.</font> <font size="3">   UTF-8 字符处理在 Web 开发中的应用(</font><a href="http://www-128.ibm.com/developerworks/cn/web/wa-lo-utf8/index.html?ca=drs"><font size="3">http://www-128.ibm.com/developerworks/cn/web/wa-lo-utf8/index.html?ca=drs</font></a><font size="3">-)</font></h1>
		<p> </p>
<img src ="http://www.blogjava.net/hgq0011/aggbug/60936.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hgq0011/" target="_blank">Harryson</a> 2006-07-31 09:37 <a href="http://www.blogjava.net/hgq0011/archive/2006/07/31/60936.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>WW标签的使用注意</title><link>http://www.blogjava.net/hgq0011/archive/2006/07/26/60210.html</link><dc:creator>Harryson</dc:creator><author>Harryson</author><pubDate>Wed, 26 Jul 2006 09:16:00 GMT</pubDate><guid>http://www.blogjava.net/hgq0011/archive/2006/07/26/60210.html</guid><wfw:comment>http://www.blogjava.net/hgq0011/comments/60210.html</wfw:comment><comments>http://www.blogjava.net/hgq0011/archive/2006/07/26/60210.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hgq0011/comments/commentRss/60210.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hgq0011/services/trackbacks/60210.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"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />总结， 如果是request.getParameter("rank")来取的，对应的WW标签就是：</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">ww:property </span><span style="COLOR: #ff0000">value</span><span style="COLOR: #0000ff">="#parameters['rank']"</span><span style="COLOR: #0000ff">/&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" />如果是request.getAttribute("rank")来取的， 对应的ww标签就是：</span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">ww:property </span><span style="COLOR: #ff0000">value</span><span style="COLOR: #0000ff">="#request['rank']"</span><span style="COLOR: #0000ff">/&gt;</span><span style="COLOR: #000000"> <br /><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span></div><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000"> A  1 </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">ww:property </span><span style="COLOR: #ff0000">value</span><span style="COLOR: #0000ff">="#request['pages']"</span><span style="COLOR: #0000ff">/&gt;</span><span style="COLOR: #000000">   2 </span><span style="COLOR: #0000ff">&lt;</span><span style="COLOR: #800000">ww:property </span><span style="COLOR: #ff0000">value</span><span style="COLOR: #0000ff">="#attr['pages']"</span><span style="COLOR: #0000ff">/&gt;</span><span style="COLOR: #000000"><br /><img src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align="top" /></span></div><img src ="http://www.blogjava.net/hgq0011/aggbug/60210.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hgq0011/" target="_blank">Harryson</a> 2006-07-26 17:16 <a href="http://www.blogjava.net/hgq0011/archive/2006/07/26/60210.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>webwork+spring+hibernate开发心得</title><link>http://www.blogjava.net/hgq0011/archive/2005/09/06/12169.html</link><dc:creator>Harryson</dc:creator><author>Harryson</author><pubDate>Tue, 06 Sep 2005 01:46:00 GMT</pubDate><guid>http://www.blogjava.net/hgq0011/archive/2005/09/06/12169.html</guid><wfw:comment>http://www.blogjava.net/hgq0011/comments/12169.html</wfw:comment><comments>http://www.blogjava.net/hgq0011/archive/2005/09/06/12169.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.blogjava.net/hgq0011/comments/commentRss/12169.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hgq0011/services/trackbacks/12169.html</trackback:ping><description><![CDATA[<P>结合webwork+spring+hibernate来开发系统感觉还是很方便的。</P>
<P>　　比如：</P>
<P>　　　1）jsp页面减少了很多java脚本（可以说是看不到了，以前采用jsp+javabean+jdbc，jsp页面真是很乱呀，到处是java脚本，这样的话就会有很多业务（business）逻辑也出现页面中，有时直接调用javaBean来处理，导致程序之间的耦合度很高），更加美观大方。</P>
<P>　　　2）webwork体现出了MVC结构。减少了程序之的耦合程度。webwork采用ongl(对象描述语言）很大程度上减少了set(),get()方法的出现。这样做，你必须在页面，javaBean,之间的命名规则要符合webwork的field-driver,model-driver的要求。</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3）程序的请求统一由com.opensymphony.webwork.dispatcher.ServletDispatcher（control）来处理,然后通过xwork.xml中的配置，取得相应的处理程序(Action)。这样减少了把一些业务逻辑写在jsp页面中。也更加清晰，有利于以后的维护。</P>
<P>　　　4）spring起到了事务管理，aop等作用。减少了很烦琐的try{}catch(){}，程序的结构感觉很清晰、明了。</P>
<P>　　　5)hibernate提供了持久化支持。面向对象的hql语言很方便。</P>
<P>　　　6）对后台的处理，都是面向接口的编程。对以后的维护很方便。</P><img src ="http://www.blogjava.net/hgq0011/aggbug/12169.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hgq0011/" target="_blank">Harryson</a> 2005-09-06 09:46 <a href="http://www.blogjava.net/hgq0011/archive/2005/09/06/12169.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>标签&lt;ww:iterator/&gt;</title><link>http://www.blogjava.net/hgq0011/archive/2005/09/05/12000.html</link><dc:creator>Harryson</dc:creator><author>Harryson</author><pubDate>Mon, 05 Sep 2005 00:59:00 GMT</pubDate><guid>http://www.blogjava.net/hgq0011/archive/2005/09/05/12000.html</guid><wfw:comment>http://www.blogjava.net/hgq0011/comments/12000.html</wfw:comment><comments>http://www.blogjava.net/hgq0011/archive/2005/09/05/12000.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hgq0011/comments/commentRss/12000.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hgq0011/services/trackbacks/12000.html</trackback:ping><description><![CDATA[<P><FONT size=2>     采用标签能够减少很多的java脚本，使得页面变得更加简洁。可标签我也得花一些时间来熟悉它。<ww:iterator/>标签用来遍历</FONT><FONT size=3>java.util.Collection, java.util.Iterator, java.util.Enumeration, java.util.Map, array, XML Node, or XML NodeList. <BR>    </FONT><FONT size=2>可我还不是很熟悉。比如我要遍历一个一对多的明细信息。我是这样处理的－－把要遍历的List 存储在session中，然后在页面中用如下的方法来调用:</P>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff"><</SPAN><SPAN style="COLOR: #800000">ww:iterator </SPAN><SPAN style="COLOR: #ff0000">value</SPAN><SPAN style="COLOR: #0000ff">="#session['shipments']"</SPAN><SPAN style="COLOR: #ff0000"> status</SPAN><SPAN style="COLOR: #0000ff">="index"</SPAN><SPAN style="COLOR: #ff0000"> id</SPAN><SPAN style="COLOR: #0000ff">="shpform"</SPAN><SPAN style="COLOR: #0000ff">></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff"><</SPAN><SPAN style="COLOR: #800000">td </SPAN><SPAN style="COLOR: #ff0000">width</SPAN><SPAN style="COLOR: #0000ff">="61"</SPAN><SPAN style="COLOR: #ff0000"> height</SPAN><SPAN style="COLOR: #0000ff">="20"</SPAN><SPAN style="COLOR: #0000ff">><</SPAN><SPAN style="COLOR: #800000">ww:property </SPAN><SPAN style="COLOR: #ff0000">value</SPAN><SPAN style="COLOR: #0000ff">="#index.count"</SPAN><SPAN style="COLOR: #0000ff">/></</SPAN><SPAN style="COLOR: #800000">td</SPAN><SPAN style="COLOR: #0000ff">><!-- 遍历的序号--></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff"><</SPAN><SPAN style="COLOR: #800000">td </SPAN><SPAN style="COLOR: #ff0000">width</SPAN><SPAN style="COLOR: #0000ff">="109"</SPAN><SPAN style="COLOR: #ff0000"> height</SPAN><SPAN style="COLOR: #0000ff">="20"</SPAN><SPAN style="COLOR: #0000ff">><</SPAN><SPAN style="COLOR: #800000">ww:property </SPAN><SPAN style="COLOR: #ff0000">value</SPAN><SPAN style="COLOR: #0000ff">="jftShipQuantity"</SPAN><SPAN style="COLOR: #0000ff">/></</SPAN><SPAN style="COLOR: #800000">td</SPAN><SPAN style="COLOR: #0000ff">><!-- 输出每一个pojo对象的属性值--></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff"></</SPAN><SPAN style="COLOR: #800000">ww:iterator</SPAN><SPAN style="COLOR: #0000ff">></SPAN></DIV></DIV></FONT><BR>   <FONT size=2>这样子的话，session中存储的东东会很多，对于页面很多的话，就会很难维护。其实我想用一个pojo的属性来get,set它，然后在页面中遍历它。可我就是不知道怎样用<ww:iterator/>来引用？？：（。还有就是，比如我遍历完刚才的东东，然后还要对每一列进行合计，也就是每一列进行求和。我是这样子做的，就是在dao中用一个方法求得每一列的和，并把它放在一个数组中，也把它存储到session中，最后在页面中用如下的代码来处理：<BR>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff"><</SPAN><SPAN style="COLOR: #800000">td </SPAN><SPAN style="COLOR: #ff0000">width</SPAN><SPAN style="COLOR: #0000ff">="109"</SPAN><SPAN style="COLOR: #ff0000"> height</SPAN><SPAN style="COLOR: #0000ff">="20"</SPAN><SPAN style="COLOR: #0000ff">><</SPAN><SPAN style="COLOR: #800000">ww:property </SPAN><SPAN style="COLOR: #ff0000">value</SPAN><SPAN style="COLOR: #0000ff">="#session['total'][0]"</SPAN><SPAN style="COLOR: #0000ff">/></</SPAN><SPAN style="COLOR: #800000">td</SPAN><SPAN style="COLOR: #0000ff">><!-- total为session中存放的对象--></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>                </SPAN><SPAN style="COLOR: #0000ff"><</SPAN><SPAN style="COLOR: #800000">td </SPAN><SPAN style="COLOR: #ff0000">width</SPAN><SPAN style="COLOR: #0000ff">="109"</SPAN><SPAN style="COLOR: #ff0000"> height</SPAN><SPAN style="COLOR: #0000ff">="20"</SPAN><SPAN style="COLOR: #0000ff">><</SPAN><SPAN style="COLOR: #800000">ww:property </SPAN><SPAN style="COLOR: #ff0000">value</SPAN><SPAN style="COLOR: #0000ff">="#session['total'][1]"</SPAN><SPAN style="COLOR: #0000ff">/></</SPAN><SPAN style="COLOR: #800000">td</SPAN><SPAN style="COLOR: #0000ff">></SPAN></DIV></DIV></FONT><BR><FONT size=2>这样子的话,也会遇到上面所提到的问题，还有就是没有一种面向对象的思想。对以后别人来维护我的代码会造成困难，难以辨认，它代表的到底是什么玩意。所以在这种情况下，大家又是怎么来处理的呢？请指点迷津，谢谢！</FONT><img src ="http://www.blogjava.net/hgq0011/aggbug/12000.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hgq0011/" target="_blank">Harryson</a> 2005-09-05 08:59 <a href="http://www.blogjava.net/hgq0011/archive/2005/09/05/12000.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>webwork&amp;jstl标签</title><link>http://www.blogjava.net/hgq0011/archive/2005/09/01/11728.html</link><dc:creator>Harryson</dc:creator><author>Harryson</author><pubDate>Thu, 01 Sep 2005 03:51:00 GMT</pubDate><guid>http://www.blogjava.net/hgq0011/archive/2005/09/01/11728.html</guid><wfw:comment>http://www.blogjava.net/hgq0011/comments/11728.html</wfw:comment><comments>http://www.blogjava.net/hgq0011/archive/2005/09/01/11728.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hgq0011/comments/commentRss/11728.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hgq0011/services/trackbacks/11728.html</trackback:ping><description><![CDATA[如果你熟悉标签的话，那么在程序设计的时候可以省很java脚本，时间，精力，这样可以更专注于业务代码。<BR>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&lt;%</SPAN><SPAN style="COLOR: #000000">@&nbsp;taglib&nbsp;uri</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">http://java.sun.com/jstl/fmt_rt</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;prefix</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">fmt</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">%&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;%</SPAN><SPAN style="COLOR: #000000">@&nbsp;taglib&nbsp;uri</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">http://java.sun.com/jstl/fmt_rt</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;prefix</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">fmt</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">%&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;%</SPAN><SPAN style="COLOR: #000000">@&nbsp;taglib&nbsp;uri</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">webwork</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;prefix</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">ww</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">%&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:</SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000">&nbsp;var</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">datePattern</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&gt;&lt;</SPAN><SPAN style="COLOR: #000000">fmt:message&nbsp;key</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">date.format</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;&lt;/</SPAN><SPAN style="COLOR: #000000">c:</SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">c:</SPAN><SPAN style="COLOR: #0000ff">set</SPAN><SPAN style="COLOR: #000000">&nbsp;var</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">ctx</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;value</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">${pageContext.request.contextPath}</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">fmt:message&nbsp;key</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">shipment.memo</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">得到对应的国际化值</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">&lt;</SPAN><SPAN style="COLOR: #000000">ww:property&nbsp;value</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">jsoNo</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">/&gt;</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000">得到action的属性值</SPAN></DIV></DIV><img src ="http://www.blogjava.net/hgq0011/aggbug/11728.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hgq0011/" target="_blank">Harryson</a> 2005-09-01 11:51 <a href="http://www.blogjava.net/hgq0011/archive/2005/09/01/11728.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>中文乱码问题</title><link>http://www.blogjava.net/hgq0011/archive/2005/08/31/11630.html</link><dc:creator>Harryson</dc:creator><author>Harryson</author><pubDate>Wed, 31 Aug 2005 05:39:00 GMT</pubDate><guid>http://www.blogjava.net/hgq0011/archive/2005/08/31/11630.html</guid><wfw:comment>http://www.blogjava.net/hgq0011/comments/11630.html</wfw:comment><comments>http://www.blogjava.net/hgq0011/archive/2005/08/31/11630.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/hgq0011/comments/commentRss/11630.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/hgq0011/services/trackbacks/11630.html</trackback:ping><description><![CDATA[<FONT size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;晕了一上午碰到了从JSP页面请求到ACTION中出现了中文问题。找了很久也不知道到底问题出现在那，郁闷呀。<IMG height=20 src="http://www.blogjava.net/Emoticons/QQ/10.gif" width=20 border=0>总觉得很奇怪，因为我是原来的系统（中文传递没有问题）中加入一些页面，也添加了一个Action，可它有中文问题了。想了很久也不能解决，真是<IMG height=20 src="http://www.blogjava.net/Emoticons/QQ/noidea.gif" width=20 border=0>呀。最后，我干脆把原来的系统还原，然后重新在系统中添加所要修改的东东，居然没有问题了。<IMG height=20 src="http://www.blogjava.net/Emoticons/QQ/14.gif" width=20 border=0><BR>总结一下原系统解决乱码的方案：<BR>　　　1)采用国际化。这样能解决页面的中文乱码问题。<BR><BR>　　　　a）把页面中所出现的中文写到属性文件中,例如：messages_zh.properties，<BR>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">shipment.system&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;出货小系统<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>shipment.jsnum&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;条码<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>shipment.stylenum&nbsp;</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">&nbsp;款式</SPAN></DIV></DIV>　　　　<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; b）native2ascii把文字转换成ascii码，<BR>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">D:\project\shipment\web\WEB</SPAN><SPAN style="COLOR: #000000">-</SPAN><SPAN style="COLOR: #000000">INF\classes</SPAN><SPAN style="COLOR: #000000">&gt;</SPAN><SPAN style="COLOR: #000000">native2ascii&nbsp;messages_zh.properties&nbsp;mess<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>ages_zh_CN.properties</SPAN></DIV></DIV><BR>　　　　c)页面统一采用utf-8编码<BR>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">&lt;%</SPAN><SPAN id=Codehighlighter1_2_67_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"></SPAN><SPAN id=Codehighlighter1_2_67_Open_Text><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">@&nbsp;page&nbsp;pageEncoding</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">utf-8</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;contentType</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">text/html;charset=utf-8</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">"</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">&nbsp;</SPAN></SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #ffff00">%&gt;</SPAN><SPAN style="COLOR: #000000"><BR></SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">meta&nbsp;</SPAN><SPAN style="COLOR: #ff0000">http-equiv</SPAN><SPAN style="COLOR: #0000ff">="Content-Type"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;content</SPAN><SPAN style="COLOR: #0000ff">="text/html;&nbsp;charset=utf-8"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN></DIV></DIV><BR>　　　&nbsp; d）在web.xml文件中引入JSTL与WEBWORK集成的类<BR>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #008000">&lt;!--</SPAN><SPAN style="COLOR: #008000">&nbsp;Define&nbsp;the&nbsp;basename&nbsp;for&nbsp;a&nbsp;resource&nbsp;bundle&nbsp;for&nbsp;I18N&nbsp;</SPAN><SPAN style="COLOR: #008000">--&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">context-param</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">param-name</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000">javax.servlet.jsp.jstl.fmt.localizationContext</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">param-name</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">param-value</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000">messages</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">param-value</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">context-param</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!-- 采用filter编码转换--&gt;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">filter</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">filter-name</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000">Set&nbsp;Character&nbsp;Encoding</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">filter-name</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">filter-class</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000">org.appfuse.web.SetCharacterEncodingFilter</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">filter-class</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">filter</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">filter-mapping</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">filter-name</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000">Set&nbsp;Character&nbsp;Encoding</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">filter-name</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">url-pattern</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000">/*</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">url-pattern</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">filter-mapping</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV><BR>　　　 　　<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e）filter类把请求的统一转换成utf-8，(在2.1.7版本以后自己处理好了)如下：<BR>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">package&nbsp;org.appfuse.web;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG id=Codehighlighter1_26_186_Open_Image onclick="this.style.display='none'; Codehighlighter1_26_186_Open_Text.style.display='none'; Codehighlighter1_26_186_Closed_Image.style.display='inline'; Codehighlighter1_26_186_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_26_186_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_26_186_Closed_Text.style.display='none'; Codehighlighter1_26_186_Open_Image.style.display='inline'; Codehighlighter1_26_186_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_26_186_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</SPAN><SPAN id=Codehighlighter1_26_186_Open_Text><SPAN style="COLOR: #008000">/*</SPAN><SPAN style="COLOR: #008000">*<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;*&nbsp;Created&nbsp;by&nbsp;IntelliJ&nbsp;IDEA.<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;*&nbsp;User:&nbsp;Administrator<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;*&nbsp;Date:&nbsp;2005-8-11<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;*&nbsp;Time:&nbsp;13:17:00<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;*&nbsp;To&nbsp;change&nbsp;this&nbsp;template&nbsp;use&nbsp;File&nbsp;|&nbsp;Settings&nbsp;|&nbsp;File&nbsp;Templates.<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>&nbsp;</SPAN><SPAN style="COLOR: #008000">*/</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>import&nbsp;java.io.IOException;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>import&nbsp;javax.servlet.Filter;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>import&nbsp;javax.servlet.FilterChain;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>import&nbsp;javax.servlet.FilterConfig;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>import&nbsp;javax.servlet.ServletException;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>import&nbsp;javax.servlet.ServletRequest;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>import&nbsp;javax.servlet.ServletResponse;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><BR><IMG id=Codehighlighter1_487_874_Open_Image onclick="this.style.display='none'; Codehighlighter1_487_874_Open_Text.style.display='none'; Codehighlighter1_487_874_Closed_Image.style.display='inline'; Codehighlighter1_487_874_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_487_874_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_487_874_Closed_Text.style.display='none'; Codehighlighter1_487_874_Open_Image.style.display='inline'; Codehighlighter1_487_874_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000">&nbsp;SetCharacterEncodingFilter&nbsp;implements&nbsp;Filter</SPAN><SPAN id=Codehighlighter1_487_874_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_487_874_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG id=Codehighlighter1_554_561_Open_Image onclick="this.style.display='none'; Codehighlighter1_554_561_Open_Text.style.display='none'; Codehighlighter1_554_561_Closed_Image.style.display='inline'; Codehighlighter1_554_561_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_554_561_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_554_561_Closed_Text.style.display='none'; Codehighlighter1_554_561_Open_Image.style.display='inline'; Codehighlighter1_554_561_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;init(FilterConfig&nbsp;arg0)&nbsp;throws&nbsp;ServletException&nbsp;</SPAN><SPAN id=Codehighlighter1_554_561_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_554_561_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG id=Codehighlighter1_695_835_Open_Image onclick="this.style.display='none'; Codehighlighter1_695_835_Open_Text.style.display='none'; Codehighlighter1_695_835_Closed_Image.style.display='inline'; Codehighlighter1_695_835_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_695_835_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_695_835_Closed_Text.style.display='none'; Codehighlighter1_695_835_Open_Image.style.display='inline'; Codehighlighter1_695_835_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;doFilter(ServletRequest&nbsp;request,&nbsp;ServletResponse&nbsp;response,&nbsp;FilterChain&nbsp;chain)&nbsp;throws&nbsp;IOException,&nbsp;ServletException&nbsp;</SPAN><SPAN id=Codehighlighter1_695_835_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_695_835_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG id=Codehighlighter1_705_739_Open_Image onclick="this.style.display='none'; Codehighlighter1_705_739_Open_Text.style.display='none'; Codehighlighter1_705_739_Closed_Image.style.display='inline'; Codehighlighter1_705_739_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_705_739_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_705_739_Closed_Text.style.display='none'; Codehighlighter1_705_739_Open_Image.style.display='inline'; Codehighlighter1_705_739_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN id=Codehighlighter1_705_739_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</SPAN><SPAN id=Codehighlighter1_705_739_Open_Text><SPAN style="COLOR: #008000">/*</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Servlet编码<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #008000">*/</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;request.setCharacterEncoding(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">utf-8</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">);&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chain.doFilter(request,response);<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG id=Codehighlighter1_864_871_Open_Image onclick="this.style.display='none'; Codehighlighter1_864_871_Open_Text.style.display='none'; Codehighlighter1_864_871_Closed_Image.style.display='inline'; Codehighlighter1_864_871_Closed_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_864_871_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_864_871_Closed_Text.style.display='none'; Codehighlighter1_864_871_Open_Image.style.display='inline'; Codehighlighter1_864_871_Open_Text.style.display='inline';" src="http://www.blogjava.net/images/OutliningIndicators/ContractedSubBlock.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">&nbsp;destroy()&nbsp;</SPAN><SPAN id=Codehighlighter1_864_871_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.blogjava.net/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_864_871_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN></DIV></DIV>　　　　<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ee）在web-inf\classes中的webwork.properties文件（可能这个就能取代上面的,有待测试）中加入<BR>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">webwork.custom.i18n.resources</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">messages<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>webwork.locale</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">zh_CN<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>webwork.i18n.encoding</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">GBK</SPAN></DIV></DIV>　<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; f）在页面中还需添加JSTL标签,当然在classpath下要加入相关的类包<BR>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">&lt;%</SPAN><SPAN style="COLOR: #000000">@&nbsp;taglib&nbsp;uri</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">http://java.sun.com/jstl/fmt_rt</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;prefix</SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">fmt</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #000000">%&gt;</SPAN></DIV></DIV></FONT>　　　<BR>　　　g<FONT size=2>）现在在页面中就可以采用jstl的EL来引入了<BR>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">fmt:message&nbsp;</SPAN><SPAN style="COLOR: #ff0000">key</SPAN><SPAN style="COLOR: #0000ff">="shipment.shipment"</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN></DIV></DIV></FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2<FONT size=2>）把tomcate下面的conf文件夹下的server.xml文件中加入 URIEncoding="GBK"，有了上面的可能这一个也是多余的，如：<BR></FONT>
<DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid">
<DIV><FONT size=2><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></FONT><SPAN style="COLOR: #000000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">Connector&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #ff0000">port</SPAN><SPAN style="COLOR: #0000ff">="8080"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;maxThreads</SPAN><SPAN style="COLOR: #0000ff">="150"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;minSpareThreads</SPAN><SPAN style="COLOR: #0000ff">="25"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;maxSpareThreads</SPAN><SPAN style="COLOR: #0000ff">="75"</SPAN><SPAN style="COLOR: #ff0000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;enableLookups</SPAN><SPAN style="COLOR: #0000ff">="false"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;redirectPort</SPAN><SPAN style="COLOR: #0000ff">="8443"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;acceptCount</SPAN><SPAN style="COLOR: #0000ff">="100"</SPAN><SPAN style="COLOR: #ff0000"><BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;debug</SPAN><SPAN style="COLOR: #0000ff">="0"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;connectionTimeout</SPAN><SPAN style="COLOR: #0000ff">="20000"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;<BR><IMG src="http://www.blogjava.net/images/OutliningIndicators/None.gif" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;disableUploadTimeout</SPAN><SPAN style="COLOR: #0000ff">="true"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;URIEncoding</SPAN><SPAN style="COLOR: #0000ff">="GBK"</SPAN><SPAN style="COLOR: #ff0000">&nbsp;</SPAN><SPAN style="COLOR: #0000ff">/&gt;</SPAN></DIV></DIV>　　　<BR>&nbsp;<BR>　　<FONT size=2>现在想想，当时可能我太性急，有点慌，盲目，所以没有注意到原来我在系统中加入了filter来转换编码（utf-8），而在我新添加的页面中没有注意到这一点，所以怎么处理还是有乱码。所以在以后的开发当中一定要沉着冷静专注，要弄清其所以然，才能顺利的解决好问题。</FONT><img src ="http://www.blogjava.net/hgq0011/aggbug/11630.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/hgq0011/" target="_blank">Harryson</a> 2005-08-31 13:39 <a href="http://www.blogjava.net/hgq0011/archive/2005/08/31/11630.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>