在Spring配置文件中即dispatcherServlet-servlet.xml配置如下。
<!-- 配置直接转发的界面 -->
<!-- 可以直接响应转发的页面,而无需再经过Handler 的方法 -->
<mvc:view-controller path="/success" view-name="success" />
通常这个时候会出现如下错误:
解决方法
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd"