Front controller interception problem in Spring MVC

    <!-- 前端控制器 -->
    <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

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325009023&siteId=291194637