0

I want to change a css class name if a variable exist on page, not sure what will be the exact code

<sec:accesscontrollist hasPermission="WRITE" domainObject="${biAccess}" var="biAccessEnabled" />
<c:if test="${biAccessEnabled}">
    <div class="features p1">
</c:if>
<div class="---what will be here? ---"></div>

[what will be here?] - here I want class name "p2" if biAccessEnabled variable is there otherwise class name "simple".... how to do it?

4

1 回答 1

0

只需使用条件 EL 运算符。

<div class="${biAccessEnabled ? 'p2' : 'simple'}"></div>
于 2013-06-28T08:12:44.243 回答