SpringMVC找不到对应的页面

确认springmvc配置文件视图解析器配置正确。

<!-- 视图解析器 -->
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/jsp/" />
        <property name="suffix" value=".jsp" />
    </bean>

确认请求路径正确。

确认web.xml中servlet-mapping配置正确。

最后页面跳转完成页面显示返回视图名称。

问题在于:

在方法上多写了@ResponseBody,所以在返回的时候并没有返回对应页面,而是返回了string。

唯有热爱方能抵御岁月漫长。
原文地址:https://www.cnblogs.com/syq816/p/9041782.html