Can I say that the Struts 2 Interceptors could be the typical example for Chain of responsibility?
The servlet dispatcher send request and a banch of interceptors process the request on the way to the action. The request can go through all the interceptor or at some point it will break the chain.
I doubt it. To me, the “Chain of responsability” pattern implies a hierarchy of candidate handlers, such that one of them either handles (and “consumes”) the object/command OR delegates it to the “superior”. By contrast, the chain of struts2 interceptors are not hierarchical (order might matter, but that’s all), and typically each interceptor does something (more akin to a “decoration” or an “observation” than to a “handling”) with the request AND passes it to the following interceptor. One does not say that “the interceptor X has handled the request”, the real handler is the struts2 Action.
Conceptually, Struts2 interceptors are very similar to the filters in the 2.3 Servlets API. And I don’t think that filters fit in the “Chain of responsability” pattern, either.