那个转向后的页面已经有用gb2312的编码了
可能原因是在java类里面调用了((HttpServletResponse)FacesContext.getCurrentInstance().getExternalContext().getResponse()).getWriter().write("");
然后再转向某个页面,这样可能导致编码格式冲突,导致乱码
可以先给resonse设置下编码格式,然后在write
HttpServletResponse httpServletResponse = (HttpServletResponse)FacesContext.getCurrentInstance().getExternalContext().getResponse();
httpServletResponse.setContentType("text/html; charset=gb2312");
httpServletResponse.setCharacterEncoding("gb2312");
httpServletResponse.getWriter().write("");
这样应该就可以解决了