CharacterEncodingFilter.java 660 B

1234567891011121314151617181920212223242526
  1. //
  2. // Source code recreated from a .class file by IntelliJ IDEA
  3. // (powered by Fernflower decompiler)
  4. //
  5. package com.happy.filter;
  6. import javax.servlet.*;
  7. import java.io.IOException;
  8. public class CharacterEncodingFilter implements Filter {
  9. public CharacterEncodingFilter() {
  10. }
  11. public void destroy() {
  12. }
  13. public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
  14. request.setCharacterEncoding("utf-8");
  15. response.setCharacterEncoding("utf-8");
  16. chain.doFilter(request, response);
  17. }
  18. public void init(FilterConfig arg0) throws ServletException {
  19. }
  20. }