«

»

Eyl
09

Else etiketi

Else etiketi if etiketi ile birlikte kullanılır. if ile kullanılan ifaden yanlış olması durumunda geçerlidir.

Örnek else

<faces>
<@import prefix="c" taglib="phpf.core" type="static"/>
<c:if test="$name=='bora'">
<c:out value="#{$name}"/>
<c:else>
<c:out value="Başka bir isim  #{$name}"/>
</c:else>
</c:if>
<faces>

Çift ve tek sayıları ayırt eden bir örnek

<faces>
<@import prefix="c" taglib="phpf.core" type="static"/>
<c:for var="$i" begin="1" to="12" step="1">
<c:if test="($i%2)==1">
<c:out value="#{$i}"/> tek sayı<br />
<c:else>
<c:out value="#{$i}"/> çift sayı<br />
</c:else>
</c:if>
</c:for>
<faces>
Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Bir Cevap Yazın

E-Posta adresiniz yayınlanmayacaktır.


*

Bu HTML etiket ve tanımlayıcılarını kullanabilirsiniz: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>