【发布时间】:2015-01-18 04:42:43
【问题描述】:
我正在使用 JSTL 在我的 JSP 中迭代 Spring 模型值。 我使用 JSTL 在我的 JSP 中显示这两个日期。
下面是我的 Java 代码:
model.put("oldest",timesheetService.getOldestPendingTimesheet(userDetails));
model.put("pending", timesheetService.getNextOldestPendingTimesheet(userDetails));
JSP 代码:
<c:choose>
<c:when test="${not empty model.oldest}">
<c:out value="${model.oldest}"/>
</c:when>
<c:when test="${not empty model.pending}">
<c:out value="${model.pending}"/>
</c:when>
</c:choose>
我在c:choose 之外显示两个日期,如下所示
oldest:Tue Nov 04 00:00:00 IST 2014
Pending:Sun Nov 09 00:00:00 IST 2014
最旧的日期在c:when 内打印,但待定仅在c:choose 外打印,而不在c:when 内打印。
上面的代码有什么问题?
【问题讨论】:
标签: java spring hibernate jsp jstl