gcw633

struts2中form提交到action中的中文乱码问题解决办法

方法一:
在struts2-core-2.1.8.1.jar包中路径为struts2-core-2.1.8.1\org\apache \struts2
有一个default.properties 文件,
 
把struts.i18n.encoding=UTF-8改为:
struts.i18n.encoding=GBK

方法二:
在struts.xml文件内添加常:<constant name="struts.i18n.encoding" value="GBK"/>

 

posted on 2010-04-22 17:05 淡淡的回忆 阅读(1771) 评论(2)  编辑  收藏

评论

# re: struts2中form提交到action中的中文乱码问题解决办法 2010-04-22 17:21 grass

去更改default.properties,也许可以成功,但是这种做法是不被认可的。
可以使用struts.properties。  回复  更多评论   

# re: struts2中form提交到action中的中文乱码问题解决办法 2010-04-23 09:20 zcl

其实只要把所有的编码都设置成ut-8即可!我就想不通,utf-8是通用的编码,干嘛又换成GBK?  回复  更多评论   


只有注册用户登录后才能发表评论。


网站导航:
 
<2010年4月>
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678

导航

统计

常用链接

留言簿

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜