java中为什么过滤器只能解决post请求乱码(=@__ @=),这是为什么呀
filter:
配置filter的Encoding=utf-8
protected void doFilterInternal(
HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
throws ServletException, IOException {
if (this.encoding != null && (this.forceEncoding || request.getCharacterEncoding() == null)) {
request.setCharacterEncoding(this.encoding);
if (this.forceEncoding) {
response.setCharacterEncoding(this.encoding);
}
}
filterChain.doFilter(request, response);
}
慕尼黑的夜晚无繁华
湖上湖
相关分类