The difference between / and /* in <url-pattern>

The difference between / and /*:

<url-pattern>/</url-pattern> 

It will match path URLs like /login, but will not match suffix URLs with a pattern of *.jsp. That is: *.jsp will not enter the DispatcherServlet class of springmvc.

<url-pattern>/*</url-pattern> 

Will match all URLs: path and suffix URLs (including /login, .jsp, .js and *.html, etc.). Will match *.jsp, and the DispatcherServlet class that enters spring again when returning to the jsp view will appear

Guess you like

Origin blog.csdn.net/yimzuenmuanggg/article/details/113737371