<%@ page contentType="text/html;charset=gb2312" %>
<html>
<TITLE>复件 网页1</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<body>
我现在测试中文乱码的问题<% request.setCharacterEncoding("gb2312");
   response.setCharacterEncoding("gb2312");
 %>
<%@ include file="/head/head.html" %>
<%@ include file="/body/body.html" %>
<%@ include file="/foot/foot.html" %>
</body>
</html>显示结果是"我现在测试中文乱码的问题"这句可以正常 显示结果。但head.html,body.htal,foot.html里面的所有页面都出现????????这样的乱码问题。怎样解决?

解决方案 »

  1.   

    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">把要include进来的页面中都加上↑
      

  2.   

    还是不能解决,是不是tomcat的问题?我的是Apache Tomcat 5.5.16 Serve
      

  3.   

    在被包含的文件中加入
    <%@ page contentType="text/html;charset=gb2312" %>
      

  4.   

    head.html,body.htal,foot.html这3个文件也要加
    <%@ page contentType="text/html;charset=gb2312" %>的
      

  5.   

    <%@ page contentType="text/html;charset=gb2312" %>
     测试通过。可以解决乱码的问题