乱码问题 速度!!!!!!!!!!!!!!!!!

Struts2 页面传值给Action 通过路径+?带值(值为该列表界面的EL表达式,如${username}该值是中文,而该${username}在请求时已经显示出来) Action获得该值时出现乱码

1.post提交的
2.设置了字符集过滤器
3.页面编码与Action一致
4.struts.xml配置文件设置编码常量
5.Action前后设置编码方式(依旧是乱码)

谢谢

[b]设置tomcat中编码[/b]

更改 D:\Tomcat\conf\server.xml,指定浏览器的编码格式为“简体中文”:
方法是找到 server.xml 中的,编码为GBK或UTF-8

[code="xml"] enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" URIEncoding='GBK' />[/code]

在action中使用[code="java"]s = new String(s.getBytes("ISO-8859-1"),"utf-8");

//或者

s = new String(s.getBytes("ISO-8859-1"),"GBK");[/code]