在使用springmvc时,都会在web.xml中配置一个dispatchservlet,如下:
<listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <!--SpringMVCServlet--> <servlet> <servlet-name>servletName</servlet-name> <servlet-class> org.springframework.web.servlet.DispatcherServlet </servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>servletName</servlet-name> <strong><url-pattern>/</url-pattern></strong> </servlet-mapping>其中/和/*的区别:
总之,关于web.xml的url映射的小知识:
本文内容总结:
原文链接:https://www.cnblogs.com/guoxiaohui/p/4888051.html