抱歉,迟到了7个月,但请尝试使用
MultilevelTotalTableDecorator
decorator,它根据您的请求生成一个空行,但这实际上是decorator应该做的一个副作用。你要想让它做你想做的事,你得考虑其他的选择。
<%
// you can do this as a scriptlet on the page, but i put it into a taglib...
org.displaytag.decorator.MultilevelTotalTableDecorator subtotals = new org.displaytag.decorator.MultilevelTotalTableDecorator();
subtotals.setGrandTotalDescription(" "); // optional, defaults to Grand Total
subtotals.setSubtotalLabel(" ", null);
pageContext.getRequest().setAttribute("subtotaler", subtotals);
%>
<display:table name="contacts" id="contactRow" defaultsort="1" defaultorder="ascending" decorator="subtotaler">
<display:column property="contactType" title="Contact Type" total="true" group="1"/>
<display:column property="contactDate" format="{0,date,MM/dd/yyyy}" title="Date" />
<display:column property="contactName" title="Name" />
<display:column property="contactPhone" title="Phone" />
<display:column property="contactEmail" title="Email" />
</display:table>