<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<c:choose>
<c:when test="${empty [b]param.name[/b]}">
Please enter your name.
</c:when>
<c:otherwise>
Hello <b><c:out value="${[b]param.name[/b]}" /></b>!
</c:otherwise>
</c:choose>
<c:choose>
<c:when test="${empty [b]param.name[/b]}">
Please enter your name.
</c:when>
<c:otherwise>
Hello <b><c:out value="${[b]param.name[/b]}" /></b>!
</c:otherwise>
</c:choose>
本文通过一个具体的示例展示了如何使用EL表达式进行条件判断。该示例利用了<c:choose>标签进行条件选择,并结合<c:when>和<c:otherwise>标签来实现根据不同输入返回不同响应的功能。
362

被折叠的 条评论
为什么被折叠?



