<!--springmvc核心控制器 --> <servlet> <servlet-name>DispatcherServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:springmvc.xml</param-value> </init-param> <!-- 屏蔽springmvc自动注册的异常处理器 --> <init-param> <param-name>detectAllHandlerExceptionResolvers</param-name> <param-value>false</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>DispatcherServlet</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> <!-- 1. /* 拦截所有请求,包括.jsp,.js,.css,.png等 (不建议使用) 2. *.do *.action 拦截以.do .action结尾的请求。(可以使用) 3. / 拦截所有,不包括jsp,但是包括.js,.png,.css (建议使用,再配合静态资源放行即可) -->
时间: 2024-11-08 13:43:48