This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Micro Frontends in Action and have Michael Geers on-line!
See this thread for details.
Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Passing Tiles into an IFRAME.

 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good morning.

I am currently in need of creating a page with a solid banner at the top of the page that never moves...with a regular website below it. We're using Struts 1.1 and Tiles and I'm having trouble getting these technologies to merge.

The idea is that we'd have an html page that holds a table up top (the banner), and an iframe on the bottom. The table would be static and would always stay on the page, and the iframe, due to its nature, would be scrollable below. In fact, this does work except for the fact that we're using tiles. Whenever I try to pass my tiles info into the iframe it loses them.

I have this in my tiles-definition.xml:

<definition name="site.default"
path="/web/jsp/layout/defaultFrameSet.jsp">
<put name="header" value="/web/jsp/include/header.jsp" />
<put name="menubar" value="/web/jsp/include/menubar.jsp" />
<put name="left-nav" value="/web/jsp/include/leftNavigation.jsp" />
<put name="body-content" value="/web/jsp/homeBody.jsp" />
<put name="sessionbar" value="/web/jsp/include/sessionbar.jsp" />
<put name="footer" value="/web/jsp/include/footer.jsp" />
</definition>


Where defaultFrameSet.jsp is this:

<!-- include the tiles library -->
<%@ include file="/web/jsp/include/javaIncludes.jsp" %>

<html>
<head>
<title>Test this Banner</title>
</head>
<body>
<tiles:insert name="content">
<tiles ut name="body-content"><tiles:getAsString name="body-content" /></tiles ut>
<tiles ut name="sessionbar"><tiles:getAsString name="sessionbar" /></tiles ut>
<tiles ut name="left-nav"><tiles:getAsString name="left-nav" /></tiles ut>
<tiles ut name="menubar"><tiles:getAsString name="menubar" /></tiles ut>
<tiles ut name="header"><tiles:getAsString name="header" /></tiles ut>
<tiles ut name="footer"><tiles:getAsString name="footer" /></tiles ut>
</tiles:insert>
<table class="unclassified" bgcolor="red">
<tr>
<td>BANNER GOES HERE</td>
</tr>
</table>
<iframe width='100%' height='92%' src='<html:rewrite page="/web/jsp/layout/defaultLayout.jsp" />' frameborder='no' scrolling='yes'></iframe>
</body>
</html>

Now, at this point things look real good until I actually call the defaultLayout.jsp. I have this to import the tiles attributes from the page above (if you leave the name of the attribute out its supposed to import them all according to the tiles docs):

However, this page errors out with a:
"javax.servlet.ServletException: Error - tag importAttribute : no tiles context found."

I guess the problem is that I'm somehow not getting my tiles passed into the "tile" context? I'm not exactly sure why my tiles attributes aren't being passed into the defaultLayout.jsp??

Thank you very much for your time!
bryan
 
Nothing? Or something? Like this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic