本文介绍了什么是doFilter在java的过滤器中的doFilter方法中做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道在我们的dofilter方法中,我打了这个电话 chain.doFilter 。什么是doFilter在doFilter中做什么?它不会得到递归调用吗?

I wanna know that in our dofilter method i made this call chain.doFilter. What is doFilter doing inside a doFilter?Is it not gonna get recursive call?

推荐答案

Servlet过滤器是责任链设计模式。

Servlet Filters are an implementation of the Chain of responsibility design pattern.

所有过滤器都是链接的(按照web.xml中的定义顺序)。 chain.doFilter()正在进入链中的下一个元素。链的最后一个元素是目标资源/ servlet。

All filters are chained (in the order of their definition in web.xml). The chain.doFilter() is proceeding to the next element in the chain. The last element of the chain is the target resource/servlet.

这篇关于什么是doFilter在java的过滤器中的doFilter方法中做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-25 11:41