【发布时间】:2018-12-27 07:40:37
【问题描述】:
我的目的是创建一个过滤器来处理 servlet 中抛出的异常。
假设我有这个过滤器:
public class FiltroAccess implements Filter{
public void destroy() {
// TODO Auto-generated method stub
}
public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain arg2)
throws IOException, ServletException {
//handle exception
}
public void init(FilterConfig arg0) throws ServletException {
// TODO Auto-generated method stub
}
}
在我的servlet 中,我抛出了Exception
我该怎么做才能在我的过滤器中处理异常?
谁能帮帮我?
【问题讨论】:
标签: java servlets filter servlet-filters