After the SSM configuration can access static html files but can not access other solutions backend interface

Section of the web.xml

    <servlet>
        <servlet-name>SpringMVC</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <!-- 配置springMVC需要加载的配置文件-->
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:spring-*.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
        <!--异步支持-->
        <async-supported>true</async-supported>
    </servlet>
    <servlet-mapping>
        <servlet-name>SpringMVC</servlet-name>
        <url-pattern>/</url-pattern>
        <url-pattern>*.js</url-pattern>
        <url-pattern>*.css</url-pattern>
        <url-pattern>*.img</url-pattern>
        <url-pattern>*.html</url-pattern>
    </servlet-mapping>

servlet-mapping is to take these url url-pattern corresponding interception, this corresponds to the name of the servlet process.
Did not start / , It will result in addition to these static resources, other interfaces are not blocked, so the 404.

Guess you like

Origin www.cnblogs.com/zxcoder/p/11833480.html
Recommended