Dear all,
I'm trying to use tiles as help when highlighting my active links with struts 2.
In my tiles.xml file I have:
<definition name="home" extends=".main">
<put-attribute name="content" value="/pages/home.jsp" />
<put-attribute name="active" type="string" value="home" />
</definition>
And in the .main template jsp
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<tiles:importAttribute name="active" />
.
.
.
However, when I try to access the variable 'active'
<s:if test="%{${active} == 'home'}">
<li class="active">
</s:if>
<s:else>
<li>
</s:else>
I see nothing coming out of ${active}.
My understanding is that this kind of task should be possible if not easy with tiles.
Any help appreciated,
Tuomo Sonninen
Tranceaddict Top 250 DJs Poll 2007 -- Vote today! -- www.tranceaddict.com/top250
I'm trying to use tiles as help when highlighting my active links with struts 2.
In my tiles.xml file I have:
<definition name="home" extends=".main">
<put-attribute name="content" value="/pages/home.jsp" />
<put-attribute name="active" type="string" value="home" />
</definition>
And in the .main template jsp
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<tiles:importAttribute name="active" />
.
.
.
However, when I try to access the variable 'active'
<s:if test="%{${active} == 'home'}">
<li class="active">
</s:if>
<s:else>
<li>
</s:else>
I see nothing coming out of ${active}.
My understanding is that this kind of task should be possible if not easy with tiles.
Any help appreciated,
Tuomo Sonninen
Tranceaddict Top 250 DJs Poll 2007 -- Vote today! -- www.tranceaddict.com/top250
