2
我有以下的web.xml:的web.xml错误页404错误路径
<servlet>
<servlet-name>dispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/mvc-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcherServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<error-page>
<error-code>404</error-code>
<location>/index.html</location>
</error-page>
当我去localhost:port/myapplication/someincorrecturl
它正确地重定向我index.html文件。但是,当我去localhost:port/myapplication/someincorrecturl1/someincorrecturl2
该应用程序给我一个404错误。如何解决具有多个路径的任何不正确的URL的问题?
正确我忘记把我的问题中的应用程序。我刚刚编辑它。 – user1383093
将它添加到web.xml Project Name display-name>中,你现在面临同样的问题了吗? –
sajid
是的,错误是一样的 – user1383093