【问题标题】:Possibility to use <c:import> with spring views可以将 <c:import> 与弹簧视图一起使用
【发布时间】: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.) 

以下方式也不起作用: &lt;jsp:include page=&lt;%@include file=

我想这不起作用,因为 Viewresolver,但是有没有一种方法可以让我以这种方式使用它,而不是通过示例使用 JavaScript。

【问题讨论】:

    标签: java spring jsp spring-mvc jstl


    【解决方案1】:

    你可以试试url的完整路径

    【讨论】:

      猜你喜欢
      • 2021-05-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-17
      • 2014-08-29
      • 2018-07-02
      • 2018-10-23
      • 1970-01-01
      相关资源
      最近更新 更多