Spring controller request mapping issue for dot in resource

本秂侑毒 提交于 2019-12-04 15:46:55

As you can see in your deployment-descriptor(web.xml) you have written something like this

    <servlet-mapping>
        <servlet-name>mvc-dispatcher</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

Which display to which URL pattern your dispatcher-servlet will respond

here <url-pattern>/</url-pattern> convey that dispatcher-servlet will respond to any URL pattern ,If you want to restrict dispatcher-servlet to be respond to specific URL you can define Url pattern somthing like below

        <servlet-mapping>
            <servlet-name>mvc-dispatcher</servlet-name>
            <url-pattern>*.htm</url-pattern>
            <url-pattern>*.html</url-pattern>
        </servlet-mapping>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!