在struts-config.xml中加:<message-resources parameter="com.your.ApplicationResources_zh_CN"/>ApplicationResources_zh_CN应该位于/web-inf/classes/com/your 目录下,
或/web-inf/lib目录下的jar包中去掉web.xml中的application参数

解决方案 »

  1.   

    to: xujiaqiang:
    我按照你说的设置了,还是乱码。还有什么地方不对吗?
      

  2.   

    TO:AllError(错误大全) :GBK也不行。
    如果message值是英文的,就没有问题。
    如何用字符集过滤器?
      

  3.   

    你用中文写好那个properties文件之后,试试先用native2ascii转换一下那个文件试试吧
      

  4.   

    已经转换好了,形如login.userName=\u9422\u3126\u57db\u935a\u5d87\u041e\u951b\ufffd
    这应该表示转换没什么问题。
      

  5.   

    扩展ActionServlet,然后覆盖process方法: 
    request.setCharacterEncoding(encoding); 
    super.process(xxx); 
    然后替换web.xml中的: 
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class> 
    就可以了。 
      

  6.   

    实现filter类,编码对字符集进行转换。