【问题标题】:Run JSTL Code Which Are Stored In Database运行存储在数据库中的 JSTL 代码
【发布时间】:2014-09-22 08:00:51
【问题描述】:

我正在使用 Spring 和瓷砖

我正在尝试执行这种类型的代码

<tiles:importAttribute name='cssBase' ignore='true' />      
<c:forEach items='${cssBase}' var='cssfile'>
        <link rel='stylesheet' href='${pageContext.request.contextPath}/${cssfile}'>
</c:forEach>

我想把这种类型放在我的jsp页面中

<link rel="stylesheet" href="/account/css/bootstrap/bootstrap.min.css">
<link rel="stylesheet" href="/account/css/bootstrap/base.css">
<link rel="stylesheet" href="/account/css/bootstrap/datatable.bootstrap.css">
<link rel="stylesheet" href="/account/css/bootstrap/jquery-ui.css">
<link rel="stylesheet" href="/account/css/bootstrap/bootstrap-select.css">
<link rel="stylesheet" href="/account/css/bootstrap/bootstrap-select.min.css">
<link rel="stylesheet" href="/account/css/bootstrap/jquery.mCustomScrollbar.css">

但我写的是&lt;c:out value="${head}"&gt;&lt;/c:out&gt; 这段代码进入我的jsp页面

但是给我输出看起来像

<tiles:importAttribute name='cssBase' ignore='true' /> 
<c:forEach items='${cssBase}' var='cssfile'> 
<link rel='stylesheet' href='${pageContext.request.contextPath}/${cssfile}'> 
</c:forEach>

给我另一种方法来做到这一点....提前谢谢

【问题讨论】:

  • 我也面临同样的问题,如果你能得到解决方案,请告诉我。

标签: jsp spring-mvc jstl tiles


【解决方案1】:
# JSTL tag
<c:import url="headerAccountCSS.html" />

【讨论】:

  • 当我们使用数据库中的 css 路径时是否有可能?
  • 首先你需要创建一个包含css和jsp路径的jsp页面,在使用ajax页面在你需要的页面中包含相同的页面之后,它会更好,但加载时间比你的要多简单的调用
  • 我正在尝试你的方式,但没有得到我需要的任何输出
猜你喜欢
  • 1970-01-01
  • 2014-11-16
  • 2014-11-30
  • 2012-06-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-05-13
  • 2014-08-03
相关资源
最近更新 更多