1 <!-- Spring mvc配置 --> 2 <servlet> 3 <servlet-name>springMvc</servlet-name> 4 <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 5 <init-param> 6 <param-name>contextConfigLocation</param-name> 7 <param-value>classpath:SpringMvc.xml</param-value> 8 </init-param> 9 <load-on-startup>1</load-on-startup> 10 </servlet> 11 <servlet-mapping> 12 <servlet-name>springMvc</servlet-name> 13 <url-pattern>/</url-pattern> 14 </servlet-mapping>
如果你在<url-pattern>/</url-pattern>编程<url-pattern>/*</url-pattern>Springmvc将会对jsp进行拦截导致其不能正常显示