想访问一个静态页面,但是一直无法访问,报错为The requested resource is not available
index.jsp如下所示,想要通过这个页码直接跳转到login.html。
<html> <body> <h2>Hello World!</h2> </body> <script> window.location.href='login.html' </script> </html>
mvc-dispatcher.xml如下所示
<!--配置静态资源访问--> <mvc:resources mapping="/css/**" location="/pages/css/" /> <mvc:resources mapping="/js/**" location="/pages/js/" /> <mvc:resources mapping="/html/**" location="/pages/"
大家应该看出来了吧,是'login.html'应该写成'html/login.html'
无语,因为这个小错误纠结这么久。顺便科普一下,spring mvc:resources标签的使用,可以看一下博客http://ericxiong.iteye.com/blog/1009030,我就是看的这个恍然大悟的