• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using Tiles Attributes with Custom Tags.

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All..

I am trying to use on of my tiles as dynamic content. I guess the custom tag doesn't like the brackets, but am I am more interested if there is a "trick" to get this to work.

tiles-def.xml
===============
<definition name="myPage" path="/tiles/baseLayout.jsp" >
<put name="title" value="Main Title" />
<put name="menuTitle" value="Menu Title" />
</definition>


baseLayout.jsp
===============
<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>
<%@ taglib uri="/MenuTag" prefix="mt" %>

<html>
<head>
<title><tiles:getAsString name="title"/></title>
</head>

<body>
<mt:menu title=<tiles:getAsString name="menuTitle"/> />
</body>
</html>
 
Nick Larson
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have tried something like this in baseLayout.jsp as well. I thought this would work, but I must be missing something.

<tiles:useAttribute id="lMenuTitle" name="menuTitle" />
<mt:menu title="<%lMenuTitle%>" />
 
Nick Larson
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok...5 more minutes, had it figured out....

I was close with my last try....

Here is what I did...

<tiles:useAttribute className="String" id="lMenuTitle" name="menuTitle" />
<mt:menu title="<%=lMenuTitle%>" />
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic