What is the difference between interception/and interception/* in Spring?
In Spring MVC-based applications, you need to add the following configuration information in web. xml:
<! -- Spring MVC 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><Url-pattern>/</url-pattern></Servlet-mapping>
Note that <url-pattern>/</url-pattern> uses/instead of/*. If/* is used /*, the request can be forwarded to the corresponding Action or Controller through DispatcherServlet, but the returned content, such as the returned jsp, will be blocked again, resulting in a 404 error, that is, the jsp cannot be accessed. If 404 errors are always found in the future, do not forget to check whether the configuration of <url-pattern>/</url-pattern> is /*.