我正在尝试一起使用fn:length
和c:when
<c:when test="${fn:trim(${properties.num2display})== null}">
<c:set var="counter" value="3"/>
condition 1
</c:when>
给我错误:
contains invalid expression(s): javax.el.ELException: Error Parsing:
${fn:trim(${properties.num2display})== null}
在fn:trim
内写表达式的正确方法是什么?
答案 0 :(得分:1)
试试这个:
<c:when test="${not empty fn:trim(properties.num2display)}">
<c:set var="counter" value="3"/>
condition 1
</c:when>