前台页面在表里object数组时为乱码,如何解决。用的框架式ssh+struts零配置

解决方案 »

  1.   

    typename=new String(typename.getBytes("iso8859-1"),"utf-8")
      

  2.   

    你的struts.xml 里面配这句话了吗?
    <constant name="struts.i18n.encoding" value="gbk"></constant>
      

  3.   

    在你的action里面加这句话 
    HttpServletResponse response = ServletActionContext.getResponse();
    response.setContentType("text/html;charset=UTF-8");
      

  4.   

    检查  JSP 页面编码  统一设置 utf-8,  提交方式 是否为 post 提交, get 提交会出现乱码, 服务器(中间件,tomcat,jboss,glassfish,weblogic) ,统一 设置编码