2017-08-03 56 views

回答

3

你想要什麼叫做Filter

The Essentials of Filters

@WebFilter(urlPatterns = "/*") // Filter all URLs 
public class VersionFilter implements Filter { 

    @Override 
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { 
     // TODO Do your filtering here 

    } 

    @Override 
    public void init(FilterConfig filterConfig) throws ServletException { ... } 

    @Override 
    public void destroy() { ... } 
} 
+0

太感謝你了!正是我所期待的 – user1865027

相關問題