<%@ include file='../include/b.jsp'%>    在a.jsp中导入b.jsp ,a.jsp中的中文没有乱码,b.jsp中的中文出现乱码  求解释。。<%@ include file='../include/b.jsp'%>   这种方式不是静态导入吗
是相当与将b.jsp中的内容直接复制到a.jsp中的相应位置?

解决方案 »

  1.   

    http://baike.baidu.com/view/1002656.htm
      

  2.   

    指定统一编码
    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
      

  3.   

    contentType="text/html; charset=UTF-8"
      

  4.   

    contentType="text/html; charset=UTF-8"UTF-8改成GBK试试
      

  5.   

    public class CharacterEncodingFilter implements Filter { public void destroy() {
    // TODO Auto-generated method stub
    System.out.println("过虑器销毁!"); } public void doFilter(ServletRequest request, ServletResponse response,
    FilterChain chain) throws IOException, ServletException {
    // TODO Auto-generated method stub
    //在请求经过过虑器的时候设置请求的编码
    request.setCharacterEncoding("UTF-8");
    //访问web资源
    chain.doFilter(request, response);
    //在响应结果经过过虑器的时候设置响应的编码
    response.setCharacterEncoding("UTF-8");
    System.out.println("使用了过虑器!"); } public void init(FilterConfig arg0) throws ServletException {
    // TODO Auto-generated method stub
    System.out.println("过虑器初始化!"); }}
      

  6.   

    若被包含的页面为html静态页面,
    则将其的charset设置为GBk2312则可以解决中文乱码问题,设置为UTF-8则不行,
    原因正是我想知道的。。原因!!!!!
     建议所有的jsp动态页面的pageEncoding统一,设置为GB2312或者UTF-8解决乱码问题
     浏览器中的编码建议设置为自动
      

  7.   

    <%@ page language="java" contentType="text/html; charset=UTF-8"
      pageEncoding="UTF-8"%>jsp文件顶端有这句话吗
      

  8.   

    <%@ page language="java" contentType="text/html; charset=UTF-8"
      pageEncoding="UTF-8"%>