tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tuomo Sirén <tu...@tranceaddict.net>
Subject active link highlighting with help of tiles
Date Tue, 02 Oct 2007 05:50:55 GMT
<DIV style="font-family:Arial, sans-serif; font-size:10pt;"><SPAN style="font-family:
monospace;">Dear all,<BR><BR>I'm trying to use tiles as help when highlighting
my active links with struts 2.<BR><BR>In my tiles.xml file I have:<BR><BR>&nbsp;
&lt;definition name="home" extends=".main"&gt;&nbsp;&nbsp; &nbsp;  <BR>&nbsp;&nbsp;&nbsp;&nbsp;
&lt;put-attribute name="content" value="/pages/home.jsp" /&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;
&lt;put-attribute name="active" type="string" value="home" /&gt;<BR>&nbsp;
&lt;/definition&gt;<BR><BR>And in the .main template jsp<BR><BR>&lt;%@
taglib uri="/struts-tags" prefix="s" %&gt;<BR>&lt;%@ taglib uri="http://tiles.apache.org/tags-tiles"
prefix="tiles" %&gt;<BR>&lt;tiles:importAttribute name="active" /&gt;<BR>.<BR>.<BR>.<BR><BR><BR>However,
when I try to access the variable 'active'<BR><BR>&nbsp;&lt;s:if test="%{${active}
== 'home'}"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp; &lt;li class="active"&gt;<BR>&nbsp;&lt;/s:if&gt;<BR>&nbsp;&lt;s:else&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;
&lt;li&gt;<BR>&nbsp;&lt;/s:else&gt;<BR><BR>I see nothing
coming out of ${active}.<BR><BR>My understanding is that this kind of task should
be possible if not easy with tiles.<BR><BR>Any help appreciated,<BR><BR><BR>Tuomo
Sonninen</SPAN><BR>&nbsp;<BR><HR>Tranceaddict Top 250 DJs Poll
2007 -- Vote today! -- www.tranceaddict.com/top250</DIV>
View raw message