in Spring 3 MVC dispather-servlet.xml with the configuration below, it seems like everytime a .js file is called the interceptor is kicked off.
My view/jsp calls four .js and the interceptor runs four times...
What is the proper way to set up the xml file so that this does not happen?
thanks
解决方案
It's actually the browser that is requesting the JS files, so 4 HTTP requests are being made to your application. You'll need to use the "mapping" element of mvc:interceptor to select a subset of paths that the interceptor will be applied to. For example: