This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts2 tags + tiles menu
 
Similar Threads
at org.apache.myfaces.tomahawk.application.jsp.JspTilesTwoViewHandlerImpl.getServletMapping
bean:define not working
problem in Tiles2 intrigation with jsf when we keep jsp in folder location
jsp tag pagination and tiles
using css file in jsp along with tiles