Jakarta ee 如果条件在显示标签中?

Jakarta ee 如果条件在显示标签中?,jakarta-ee,struts,displaytag,Jakarta Ee,Struts,Displaytag,如果行的值等于“总计”,我想显示链接,否则我在代码段下面尝试了纯文本,但出现错误 <display:table name="expScoreCardCol" export="true" pagesize="20" sort="list" id="data" requestURI="" class="tablelist"> <display:column title="Zone" sortable="true" property="zone"></d

如果行的值等于“总计”,我想显示链接,否则我在代码段下面尝试了纯文本,但出现错误

<display:table name="expScoreCardCol" export="true" pagesize="20" sort="list" id="data" requestURI="" class="tablelist">   

     <display:column title="Zone" sortable="true" property="zone"></display:column>              
    <display:column title="Non-HNI Total" sortable="true" property="nonhniTotal"></display:column>   
        <display:column title="Non-HNI Per %" sortable="true" property="nonhniPer"></display:column>   

    <%if(!${data.zone}=="GRAND TOTAL"){ %>       
        <display:column title="Grand Total" sortable="true">   
        <html:link action="/exceptionScoreCardGrandReport.do?zone=${data.zone}"><b>${data.grandTotal}</b></html:link>   
        </display:column>   
        <%} %>   
</display:table>  

不要使用scriptlet。从未。使用JSTL和EL。并且理解EL不能在scriptlet中使用:scriplets包含Java代码,EL不是Java

此外,如果特定行不是总计,则代码会添加一列。这不是应该做的。列应始终存在,但其内容应根据行的不同而变化:

<display:table name="expScoreCardCol" export="true" pagesize="20" sort="list" id="data" requestURI="" class="tablelist">
    <display:column title="Zone" sortable="true" property="zone" />
    <display:column title="Non-HNI Total" sortable="true" property="nonhniTotal" />
    <display:column title="Non-HNI Per %" sortable="true" property="nonhniPer" />
    <display:column title="Grand Total" sortable="true">
        <c:if test="${data.zone != 'GRAND TOTAL'}">       
            <html:link action="/exceptionScoreCardGrandReport.do?zone=${data.zone}">
                <b>${data.grandTotal}</b>
            </html:link>
        </c:if>
    </display:column>      
</display:table>

${data.grandTotal}

不要使用scriptlet。从未。使用JSTL和EL。并且理解EL不能在scriptlet中使用:scriplets包含Java代码,EL不是Java

此外,如果特定行不是总计,则代码会添加一列。这不是应该做的。列应始终存在,但其内容应根据行的不同而变化:

<display:table name="expScoreCardCol" export="true" pagesize="20" sort="list" id="data" requestURI="" class="tablelist">
    <display:column title="Zone" sortable="true" property="zone" />
    <display:column title="Non-HNI Total" sortable="true" property="nonhniTotal" />
    <display:column title="Non-HNI Per %" sortable="true" property="nonhniPer" />
    <display:column title="Grand Total" sortable="true">
        <c:if test="${data.zone != 'GRAND TOTAL'}">       
            <html:link action="/exceptionScoreCardGrandReport.do?zone=${data.zone}">
                <b>${data.grandTotal}</b>
            </html:link>
        </c:if>
    </display:column>      
</display:table>

${data.grandTotal}

编译时错误..请参阅上面更新的postcompile时间错误..请参阅上面更新的post