【发布时间】:2011-03-26 06:36:42
【问题描述】:
我想知道是否有可能我可以使用 JSTL 函数来导入 spring 视图。
所以是这样的:
<div id="contentHolder">
<c:import url="/foo.do?bar" />
</div>
在 XML 中:
<!-- Viewresolver -->
<b:bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<b:property name="viewClass"><b:value>org.springframework.web.servlet.view.JstlView</b:value></b:property>
<b:property name="prefix"><b:value>/WEB-INF/jsp/</b:value></b:property>
<b:property name="suffix"><b:value>.jsp</b:value></b:property>
</b:bean>
但是通过这种方式我得到了错误:
Circular view path [/WEB-INF/jsp/foo/index.jsp]: already dispatched to this view path within the same request [/BAR/WEB-INF/jsp/foo/index.jsp]. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
以下方式也不起作用:
<jsp:include page= 和 <%@include file=
我想这不起作用,因为 Viewresolver,但是有没有一种方法可以让我以这种方式使用它,而不是通过示例使用 JavaScript。
【问题讨论】:
标签: java spring jsp spring-mvc jstl