该死的ClientAbortException:错误,求解!!

package servlet;

import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import beans.FilterIP;

public class FilterToAll implements Filter {
    private String ip = null;
    FilterIP filterIP = new FilterIP();
    public void init(FilterConfig filterConfig){
        System.out.println("***过滤器启动***");
    }
    public void doFilter(ServletRequest req,ServletResponse resp,FilterChain chain){
        try {
            HttpServletRequest reqH = (HttpServletRequest) req;
            HttpSession session=reqH.getSession();
            session.setAttribute("filterIP",filterIP);
            ip = req.getRemoteAddr();
            Boolean status = filterIP.isBadIP(ip);
            if(!status){
                req.getRequestDispatcher("badip.jsp").forward(req,resp);
                return;
            }
            chain.doFilter(req,resp);
        } catch (IOException e) {
            System.out.println("1636:FilterToAll类出错!/n"+e);
        } catch (ServletException e) {
            System.out.println("1637:FilterToAll类出错!/n"+e);
        }
    }
    public void destroy(){
        System.out.println("***过滤器销毁***");
    }
}

 

以上代码老抛1636:FilterToAll类出错!ClientAbortException:  java.net.SocketException: Connection reset by peer: socket write error
网上很多人说有类似问题,有没有人能解决?很多人说是服务器向客户端传送数据时客户端突然终止浏览器导致的,有人有办法解决么?我的异常都是写到控制台的,一旦错误过多会不会当机啊?

你可能感兴趣的:(该死的ClientAbortException:错误,求解!!)