In the representation of the J2EE architecture, you need to do some corresponding processing for different users, some requests can be delivered directly to the Controller, some requests need to decode or verify, the usual practice is to write a bunch of nested IF / The ELSE statement, but such a structure does not have scalability. Use J2EE Pattern in Intercepting Filter pattern can solve this problem Create pluggable filters to process common services in a standard manner without requiring changes to core request processing code. The filters intercept incoming requests and outgoing responses, allowing preprocessing and post-processing. We are able to add and remove these filters unobtrusively, without requiring changes to our existing code.Intercepting Filter uses the Decorator pattern in GoF Petstore on the application by the two classes to this pattern: EncodingFilter, SignOnFilter, they realize javax.servlet.Filter interface