问题
JSF 用commandButton 刷新页面出现乱码
解决:
汗,去掉了primeface 依赖好像就行了
页面编码都需要设置成utf8
不需要什么filter 转码
以上不行
以前的项目都正常
我用最基本的hello 发现
第一次就会出现乱码
解决用filter 设置
|
request.setCharacterEncoding("UTF-8"); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
/** * * @author Administrator */ @WebFilter("/*") public class CodingFilter implements Filter { private static final Logger LOG = Logger.getLogger(CodingFilter.class.getName()); @Override public void init(FilterConfig filterConfig) throws ServletException { } @Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { LOG.info("fdsafds"); request.setCharacterEncoding("UTF-8"); chain.doFilter(request, response); } @Override public void destroy() { } } |