How does spring customize the interceptor?

wants to implement such a function through a custom interceptor: if the client requests that the file / website/img/abc.jpg exists, it will be returned, if it does not exist, the file will be created and returned. May I ask how to achieve it?


for access to static resources, filters are recommended. Interceptors are used to handle dynamic requests, which are too convenient to respond to static resources.


agrees with < Wu Qinghai >. You can consider using / website/img/abc to access the interface and the interface to determine whether the resource file exists: create a return if it does not exist, and return the file directly if it exists

Menu