2013-03-14 95 views
0

Inside <c:chosse>当我们有多个<c:when>标签时,它的行为就像是if else else else逻辑结构。但是,如果我想做的事:使用jstl逻辑标签

if(){ 
    if(){} 
    else if{} 
    if(){} 
    if(){} 
    if(){} 
    else{} 
} 

然后我可以使用沿侧<c:when><c:if><c:choose>

<c:choose> 
    <c:when> 
    <c:when> 
    <c:if> 
    </:if> 

    <c:if> 
    </:if> 

    <c:when> 
    </:when> 

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

我似乎工作,但行为存在保证?

+0

没有正确的缩进,这段代码是不可能读取的。 – 2013-03-14 22:43:26

回答

0

您可以使用jstl,但考虑更改逻辑并将其移动到后端,因为它在jsp中会过于复杂。