【发布时间】:2018-05-06 09:01:22
【问题描述】:
我想使用html 页面而不是jsp 页面。但是在使用 html 页面时出现错误。但是如果我使用 jsp 页面,我不会收到任何错误。
当我使用<property name="suffix" value=".jsp"/>时,我没有收到任何错误。这是我的spring-servlet.xml 文件
http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<mvc:annotation-driven/> <context:component-scan base-package="org.avijit"/> <bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/WEB-INF/views/"/> <property name="suffix" value=".html"/> </bean>
我的Controller 班级是
package org.avijit; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @Controller public class BaseController { @RequestMapping(value="/", method = RequestMethod.GET) public String homePage() { return "welcomePage"; } }
【问题讨论】:
-
welcomePage.html的内容是什么?
标签: java html jsp spring-mvc