I'm not sure exactly what you are attempting to perform, but
you should be able to tie the selected attribute to a backing bean value. In coding this way, your backing bean will determine if the value is true or false. You can get rid of the JSTL altogether and just do something like this:
<tr:commandNavigationItem immediate="true"
text="Contracts"
action="guide.page"
selected="#{bean.selectedValue}"/>
I do not use JSTL anywhere in JSF code at this time unless absolutely necessary. You should try to perform all comparisons and business logic within the backing beans if possible.
I hope this will work for your situation. Otherwise, your JSTL solution may be the best alternative.