我觉得这样才对
if (session.getAttribute("password")!=null) {
arg2.doFilter(arg0, arg1);
}else {
response.sendRedirect(request.getContextPath()+"/login.jsp");
}
if (session.getAttribute("password")!=null) {
arg2.doFilter(arg0, arg1);
}else {
response.sendRedirect(request.getContextPath()+"/login.jsp");
}
老师这里ppt写错了吧,应该是forward和include通过.forward和.include方法以及<jsp:forward/include ...时不会调用过滤器。
2016-12-11