File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Non-scrollable Tile? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Non-scrollable Tile?" Watch "Non-scrollable Tile?" New topic

Non-scrollable Tile?

bryan nelson
Ranch Hand

Joined: Jun 16, 2003
Posts: 95
Good morning,

I have a web application that I need to display a constant banner at the top of. It needs to be non scrollable as well. Just a solid inch deep banner that stays visible no matter where you go in the site below.

Now I know that I can do this with frames, but I really don't want to go there if I don't have to. I'm assuming that I can do something like this with a tile perhaps? Is there a better way? I'm using Struts 1.1.

Any ideas are appreciated.


"...and the Truth will set you free."
Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

Tiles get rendered into html before the browser ever sees anything. This means that your solution must come from html or javascript, as tiles do not directly affect how a browser interprets the html.

Frames are one option. Javascript is another option but such a solution with Javascript... let's just say it's difficult to get smooth-scrolling. It might also be possible to put all the rest of the page's content in a scrollable area within the browser window.

A good workman is known by his tools.
bryan nelson
Ranch Hand

Joined: Jun 16, 2003
Posts: 95
After thinking a little bit more about the nature of tiles, I understand what you're saying. And I've decided to stay away from the JavaScript if I can. I'm trying to use an IFrame to accomplish my goal. Which I can do just fine. However, I'm having trouble using that AND tiles. I'm currently doing something like this (which is failing):

In my tile definition I have this:

<definition name="mySite.default"
<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" />

where I changed the item in gray to point to the IFrame as you can see above (it used to point to the Layout below).

In my new defaultIFrame.jsp I have this:


<table class="unclassified">
<iframe width='100%' height='92%' src='<html:rewrite page="/web/jsp/layout/defaultLayout.jsp" />' frameborder='no' scrolling='yes'></iframe>

This works in the sense that it gives me the little unscrollable piece at the top (the table with the "green" TD), but the Iframe below gives a jsp NPE because of the tile attributes being blank. And I understand that too, because I'm not calling the defaultLayout.jsp from the tile-def'n any longer and it has no knowledge of the "puts" (if you will) once I get to the regular jsp page.

So my question do I make it so I can display an entire tiles layout in an Iframe? There has to be a way to do this...

Thanks again!
[ March 23, 2005: Message edited by: bryan nelson ]
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
You have two choices, frame your page

or do a search on google for JavaScript watermark.

bryan nelson
Ranch Hand

Joined: Jun 16, 2003
Posts: 95
Well the watermark is out.

Looks like I'll have to resort to frames. *wince*
I agree. Here's the link:
subject: Non-scrollable Tile?
It's not a secret anymore!