File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts2 tags + tiles menu Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 tags + tiles menu" Watch "Struts2 tags + tiles menu" New topic

Struts2 tags + tiles menu

Konstantin Netkachev

Joined: Jul 24, 2009
Posts: 15
In Apache Tiles documentation there is a sample for simple menu:



For jstl tags it works good, but how to do the same with Struts 2 tags?
I tried something like that:

but it doesn't work.
Johannes Geppert
Ranch Hand

Joined: Jan 12, 2010
Posts: 67
with struts2 you need to use OGNL to access the values from the stack.

Try out:

<s:iterator value="myListAttribute" var="item">
<a href="%{}">%{item.value}</a>

or without var

<s:iterator value="myListAttribute">
<a href="%{link}">%{value}</a>


My Java and Webprogramming Blog
Konstantin Netkachev

Joined: Jul 24, 2009
Posts: 15
Both variants don't work.
I agree. Here's the link:
subject: Struts2 tags + tiles menu
It's not a secret anymore!