jsp中判断的问题(例如不同权限有不同操作,页面相同)

来源:互联网 发布:安与知耻 编辑:程序博客网 时间:2024/05/20 08:23
要实现类似的效果:

<c:if test="${条件1}"></c:if>

<c:if test="${条件2}"></c:if>

<c:if test="${条件3}"></c:if>

<c:if test="${条件4}"></c:if>

这种形式来写的话,就要判断四次,以下的形式,后面的三个IF都不执行了,就是类似于SWITCH的JSTL的实现

上代码:

<c:choose>
<c:when test="${条件}">

</c:when>
<c:when test="${条件}">

</c:when>
<c:when test="${条件}">

</c:when>
<c:otherwise>
</c:otherwise>

</c:choose>


这样就ok了



Javascript刷新页面的几种方法:1    history.go(0) 2    location.reload() 3    location=location 4    location.assign(location) 5    document.execCommand('Refresh') 6    window.navigate(location) 7    location.replace(location) 8    document.URL=location.href 

0 0
原创粉丝点击