EL表达式错误

时间:2013-04-05 03:02:22

标签: jstl el

我正在尝试一起使用fn:lengthc: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内写表达式的正确方法是什么?

1 个答案:

答案 0 :(得分:1)

试试这个:

<c:when test="${not empty fn:trim(properties.num2display)}">
    <c:set var="counter" value="3"/>
    condition 1 
</c:when>