SM配置以拦截.action或以.do结尾的web.xml中的配置

以前在使用Spring配置拦截请求的时候,都是拦截以"/"的所有请求,并在Spring-mvc.xml中配置静态资源拦截器

下面是配置以拦截*.action*.do的基本操作.
1.在web.xml中配置

  
/.action

2.在web.xml中配置Spring的拦截

 
    springServlet
    org.springframework.web.servlet.DispatcherServlet
    
        contextConfigLocation
        classpath:spring-mvc.xml
    
    1


    springServlet
    *.action
`

并在所有的controller中跳转到Servlet动作的requestMapping()后添加.action就可以实现拦截.action请求了.

你可能感兴趣的:(SM配置以拦截.action或以.do结尾的web.xml中的配置)