编辑PROJECT/src/main/webapp/WEB-INF/tags/form/fields/table.tagx
. 在第 78 行,您应该看到<c:set var="columnDatePattern" value="${patterns[num.count-1]}" />
. 在该行下放置以下代码:
<!-- Get the last descendant property -->
<c:set var="prop" value="${item}" />
<c:forTokens items="${column}" delims="." var="subprop">
<c:if test="${not empty prop}">
<c:set var="prop" value="${prop[subprop]}" />
</c:if>
</c:forTokens>
<!-- Now under tag c:choose below, please change from "item[column]" into "prop" -->
<!-- // End of Get the last descendant property. -->
不要忘记从更改"item[column]"
为"prop"
. 例如,更改后的行应为:
<c:choose>
<c:when test="${columnType eq 'date'}">
<spring:escapeBody>
<fmt:formatDate value="${prop}" pattern="${fn:escapeXml(columnDatePattern)}" var="colTxt" />
</spring:escapeBody>
</c:when>
<c:when test="${columnType eq 'calendar'}">
<spring:escapeBody>
<fmt:formatDate value="${prop.time}" pattern="${fn:escapeXml(columnDatePattern)}" var="colTxt"/>
</spring:escapeBody>
</c:when>
<c:otherwise>
<c:set var="colTxt">
<spring:eval expression="prop" htmlEscape="false" />
</c:set>
</c:otherwise>
</c:choose>