1 11 12 package org.jivesoftware.util; 13 14 import javax.servlet.*; 15 import java.io.IOException ; 16 17 18 23 public class SetCharacterEncodingFilter implements Filter { 24 25 public void init(FilterConfig filterConfig) throws ServletException { 26 27 } 28 29 public void destroy() { 30 31 } 32 33 36 public void doFilter(ServletRequest request, ServletResponse response, 37 FilterChain chain) throws IOException , ServletException 38 { 39 request.setCharacterEncoding("UTF-8"); 40 response.setContentType("text/html; charset=" + "UTF-8"); 41 chain.doFilter(request, response); 42 } 43 } 44 | Popular Tags |