EL表达式语言(二)

若是你没有EL基础,请移步:http://my.oschina.net/passer007/blog/608675
express

Empty运算符

    在EL表达式中,有一个特殊的运算符——empty,该运算符是一个前缀运算符,即empty运算符位于操做符前方,用来肯定一个对象或者变量是否为空:spa

            ${empty expression}//expression用于指定要判断的对象或者变量.net

    同时empty也能够与not结合即not empty来判断一个元素或者对象是否非空对象


条件运算符

    在EL表达式中能够利用条件运算符进行条件求值:blog

        ${条件表达式?计算表达式1:计算表达式2}get

        ${empty user?"user为空" : user}io


EL中表达式的保留字

and    eq    gt    true    instanceof    div    or    ne    le    false    lt    empty    mod    not    ge    null基础

相关文章
相关标签/搜索