我是靠谱客的博主 大胆帅哥,这篇文章主要介绍c:if jsp中的if判断没有嵌套的c:if,现在分享给大家,希望可以做个参考。

没有嵌套的c:if

带有状态的c:if var关键字

复制代码
1
2
3
4
5
6
7
8
9
10
<tr> <c:if test="${j.isenabled}" var="t"> <th><span class="glyphicon glyphicon-ok" aria-hidden="ture"></span></th> </c:if> <c:if test="${!t}"> <th><span class="glyphicon glyphicon-remove" aria-hidden="ture"></span></th> </c:if> </tr>

其中的span标签里面的class是bootstrap自带的图标
上面的判断流程是如果j点isenabled为真(标记这个状态为t)就执行下面的代码
非t就是假

写在input里面的c:if

input是单标签,最后面的斜杠可以不写

复制代码
1
2
3
4
5
6
<input type="radio" name="positiontype" id="workingTime" value="1" <c:if test="${condition.positiontype==1 }"> checked="checked" </c:if> />
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<label class="radio-inline"> <input type="radio" name="positiontype" id="positiontype" value="1" <c:if test="${ job1.positiontype==1 }"> checked = "checked" </c:if> >全职 </label> <label class="radio-inline"> <input type="radio" name="positiontype" id="positiontype" value="0" <c:if test="${ job1.positiontype==0 }"> checked = "checked" </c:if> >兼职 </label>

最后

以上就是大胆帅哥最近收集整理的关于c:if jsp中的if判断没有嵌套的c:if的全部内容,更多相关c:if内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(88)

评论列表共有 0 条评论

立即
投稿
返回
顶部