<!-- 前端控制器 --> <servlet> <servlet-name>ssm</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> </servlet> <servlet-mapping> <servlet-name>ssm</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping>
①, [/]: It will intercept all urls, such as: /test, /test1.html, /1.jpg..., but will not be handed over to the front controller except for urls ending with jsp.
②, [/*]: It contains [/], you can intercept more urls ending with *.jsp
③, [*.xxx]: This intercepts url requests with fixed endings, common ones are *.do, *.json, *.action