下面显示的是结果,我用的是idea,和老师讲的一样的代码,但是输出却是重复的?why?
FirstFilter Filter{ destroy() { System..println(); } doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) IOException, ServletException { System..println(); filterChain.doFilter(servletRequest,servletResponse); System..println(); } init(FilterConfig filterConfig) ServletException {System..println(); } }
这是FirstFilter
SecondFilter Filter { destroy() { System..println(); } doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) IOException, ServletException { System..println(); filterChain.doFilter(servletRequest,servletResponse); System..println(); } init(FilterConfig filterConfig) ServletException { System..println(); } }