【发布时间】:2012-12-22 02:11:58
【问题描述】:
我正在尝试熟悉 XMLViewResolver,因此我在 m *-servlet.xml 中包含以下内容:
<bean class="org.springframework.web.servlet.view.XmlViewResolver">
<property name="location">
<value>/WEB-INF/spring-views.xml</value>
</property>
<property name="order" value="0" />
</bean>
Spring-views.xml 看起来像这样(只是一个 sn-p):
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id="insertEntryForm" class="org.springframework.web.servlet.view.JstlView">
<property name="url" value="/WEB-INF/views/admin/insertEntryForm.jsp"></property>
</bean>
....
当我尝试加载这个 jsp 时,它给了我以下错误:
"NetworkError: 404 Not Found - http://localhost:8080/LiteratureVisualization/admin/insertEntryForm.html"
我该如何解决这个问题? 我想使用 XMLViewResolver,因为我可以单独映射多个文件夹(在视图目录内)......或者有不同的解决方案吗?
【问题讨论】:
标签: spring spring-mvc resolver