File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

Struts2 tags + tiles menu

Konstantin Netkachev
Greenhorn

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

tiles.xml:

myjsp.jsp:

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.link}">%{item.value}</a>
<br/>
</s:iterator>


or without var

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



Johannes

My Java and Webprogramming Blog
Konstantin Netkachev
Greenhorn

Joined: Jul 24, 2009
Posts: 15
Both variants don't work.
 
wood burning stoves
 
subject: Struts2 tags + tiles menu