Is there a way for some specific urls to be excluded from being intercepted by the spring mvc controller?
web.xml
<servlet>
<servlet-name>mvc-dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>mvc-dispatcher</servlet-name>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>
controller:
@RequestMapping(value="getState.jsp", method = RequestMethod.GET)
public @ResponseBody Map<String,? extends Object> loadStates() {
....... }
Now if I request index.jsp,it would say 'No mapping found' and the page would not be rendered.
What's the best practice to avoid this situation in annotation-based deployments?