filter在網頁中如何運用呢?
// filter 可以獲取到request對象, 使用request的轉發,可以轉發到其他html,jsp,servlet等public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if(condition){ System.out.println("filter"); request.getRequestDispatcher("index.jsp").forward(request, response); }else{ chain.doFilter(request, response); } }