how to eliminate code repeating in jsf page?

Hello!

I have code

<c:choose>

<c:when test="${headerBacking.selected == '/trinidad/faces/contracts.jspx'}">

<tr:commandNavigationItem

immediate="true"

text="Contracts"

action="guide.page"

selected="true"/>

</c:when>

<c:otherwise>

<tr:commandNavigationItem

immediate="true"

text="Contracts"

action="guide.page"

selected="false"/>

</c:otherwise>

</c:choose>

If and else part is little bit different, parameter SELECTED value is different.

how better to eliminate code repeating in jsf page in this situation?

Thanks! :)

[934 byte] By [rookie_84a] at [2007-11-27 6:00:10]
# 1
EL just accepts conditional expressions.selected="#{headerBacking.selected == '/trinidad/faces/contracts.jspx'}" should do.
BalusCa at 2007-7-12 16:37:59 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thanks! :) Cool solution!
rookie_84a at 2007-7-12 16:37:59 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...