Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts2 tags + tiles menu

 
Konstantin Netkachev
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Konstantin Netkachev
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Both variants don't work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic