Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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 Murach's Java Servlets and JSP this week in the Servlets 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.
 
 
subject: Struts2 tags + tiles menu
 
Similar Threads
problem in Tiles2 intrigation with jsf when we keep jsp in folder location
bean:define not working
using css file in jsp along with tiles
jsp tag pagination and tiles
at org.apache.myfaces.tomahawk.application.jsp.JspTilesTwoViewHandlerImpl.getServletMapping