You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Avinash Gangadharan <ag...@ucdavis.edu> on 2004/02/19 22:27:41 UTC
Tiles and message resources
Group,
I'm having a problem if I use the message-resources inside my tiles
jsp. I'm doing something similar to the standard tiles sample for designing
a layout for menus with the selected menu shown differently.
I'm doing something like this :
<% String sel = ( String ) request.getAttribute( foo.SELECTEDMENU ); %>
<tiles:insert page="/jsp/layout/submenuLayout.jsp" flush="true">
<tiles:put name="title"><bean:message key="menu.title"/></tiles:put>
<tiles:putList name="items" >
<tiles:add><bean:message key="menu.menu1"/> </tiles:add>
<tiles:add><bean:message key="menu.menu2"/></tiles:add
</tiles:putList>
<tiles:putList name="links" >
<tiles:add value="/do/someAction" />
<tiles:add value="/do/someOtherAction" />
</tiles:putList>
<tiles:put name="selected" value="<%=sel%>"/>
</tiles:insert>
Now in my layout, I check for the selected menu and do something like :
<logic:equal name="selected" value="<%=item%>">
<span class="sel"><%=item%></span>
</logic:equal>
Here item is the value of the Menu Items( <bean:message key="menu.menu1"/>
etc... ) which I iterate over.
The menu items gets rendered just fine. But the above logic block never
returns a true and therefore never prints the selected menu in the way I
want it to.
So I see the menu normally with none of them selected.
The moment I replace the <bean:message... With hard coded values, it starts
working.
Could someone tell me if I'm missing something.
Thanks and Regards
Avinash
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org