struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Java Programmer" <jprogrami...@gmail.com>
Subject Tiles & menus
Date Wed, 22 Nov 2006 13:07:23 GMT
Hello,
I have some troubles with finding examples of using SimpleMenuItem and
<item> tags within <definition>, so far I did menu like this:
- part of tiles-def.xml:
<definition name="aPage" path="/pages/TileExample1.jsp">
        <put name="title"  value="Another Title" />
        <put name="body"   value="aPage.body" />
       	<putList name="menu">
    		<item link="/link1.jsp" value="Link 1" />
    		<item link="/link2.jsp" value="Link 2" />
    		<item link="/link3.jsp" value="Link 3" />
    	</putList>
</definition>
- part of jsp *tile*
<tiles:importAttribute name="menu" />

<c:forEach items="${menu}" var="menuItem">
	<a href="<c:out value="${menuItem.link}" />"><c:out
value="${menuItem.value}" /></a>
</c:forEach>
So first I import attribute into jsp context, and further iterate
through it with jstl forEach / out tags. Is this good solution? Are
there any better for using SimpleMenuItem in JSP pages?

Best regards,
Adr

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message