c:if jsp中的if判断

没有嵌套的c:if

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

<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是单标签,最后面的斜杠可以不写

<input type="radio" name="positiontype" id="workingTime" value="1"
	<c:if test="${condition.positiontype==1 }">
		checked="checked"
	</c:if>
/>
<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>
  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值