[/code]大家都知道<c:choose>标签可以进行if、else的判断;
但是今天我遇到了一个问题,when 中 test 条件值为真(以及打印证实为true)但是不执行when中body语句。而是转向otherwise,郁闷了半天;
代码如下:
解决方案:
有木有发现 [color=red]<c:when test="${1 == 1} ">[/color] 中[color=red]多[/color]了一个[color=red]空格[/color]
[color=red]删除空格[/color],则正常执行~~~~
但是今天我遇到了一个问题,when 中 test 条件值为真(以及打印证实为true)但是不执行when中body语句。而是转向otherwise,郁闷了半天;
代码如下:
<c:choose>
<c:when test="${1 == 1} ">
1,is true.
</c:when>
<c:otherwise>
1 is not 1;
<c:otherwise>
<c:choose>
解决方案:
有木有发现 [color=red]<c:when test="${1 == 1} ">[/color] 中[color=red]多[/color]了一个[color=red]空格[/color]
<c:when test="${1 == 1}">
[color=red]删除空格[/color],则正常执行~~~~