jsp EL表达式if-else三种用法

时间:2017-03-29 23:45:57   收藏:0   阅读:1949

一,条件运算符

${user.gender==1?‘男‘:‘女‘}

二,if标签

<c:if test="boolean">text</c:if>

三,when-otherwise标签

<c:choose>

  <c:when test="boolean">code..</c:when>

  <c:otherwise>code..</c:otherwise>

</c:choose>

最后,当然,多个if也能达到java中if-if的效果

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!