Difference between Interceptors and Filters - Is this right?

后端 未结 4 1425
长发绾君心
长发绾君心 2021-02-05 17:49

I\'m researching this so that I can respond better in interviews. I\'ve been searching around for a clear and concise answer.

So far, and by all means correct me if I a

4条回答
  •  一生所求
    2021-02-05 17:57

    Filters:

    1. Based on Servlet Specification
    2. Executes on the pattern matches on the request.
    3. Not configurable method calls.

    Interceptors:

    1. Based on Struts2.
    2. Executes for all the request qualifies for a front controller (a Servlet filter). And can be configured to execute additional interceptors for a particular action execution.
    3. Methods in the Interceptors can be configured whether to execute or not by means of excludeMethods or includeMethods.

提交回复
热议问题