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

Should I or should I not use frames

Bruce Sparo

Joined: Jun 24, 2004
Posts: 9
I'm building a page using STRUTS and was wondering whether or not I should use FRAMES or go with something else... say TILES.

The thing is, the page is fairly complex. Up to 5 different .jsp's will be used on the main page and although the main page will always be the same (the same .jsp files will always be displayed) the information being displayed will be built dynamically and will be dependent upon what is entered/clicked on in any of the .jsp on the main page. (Does that make sense? I hope so.)

The thing that worries me is that I'm using a scroll bar and I'm worried that if I do go with tiles, that will be a problem.

As you can tell, I'm "very" new to struts so your suggestion/advice will be greatly appreciated because, as of right now, I'm using html:frames.
[ June 24, 2004: Message edited by: Bruce Sparo ]

If I haven't already said it... THANKS for responding.
Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

IMO, few things work well with frames.

Javadoc is a good example for frames - no input & all output and there are not many mutual dependencies between frames.

Basically, you'll probably be better off with tiles.

A good workman is known by his tools.
Jason Ruel

Joined: Apr 07, 2004
Posts: 1
I've never used Tiles (and know little about it), but whether or not to use frames in a Web application is dependent upon a few things.

When to use frames:
- If your pages contain common elements (such as navigation menus) that are used (or can be used) on ALL pages, then moving to a frame can be a good idea (though you should generally just include it).
- If you application has data that should be displayed at intervals to the user, whether or not they are changing pages, then frames are good. (Examples would be advertisement banners that you want to change at intervals, which, even then, may open iframes as the better choice.)

When NOT to use frames:
- If you use them to simply combine JSP/HTML files for the purpose of constructing a single page, then do not use them. Use includes instead.
- If the data that would appear in each frame does not change or is not dependent on the content of other frames, then do not use them.
- If the content displayed is is generated to the point that bookmarking the page can be useful, then do not use frames.

One of my favorite uses of frames has to be what IBM has done for the WebSphere Application Server v5.0. They constructed the admin console using Struts and with frames. The top frame has the logo/header file (static) and the bottom frame has three more frames. On the left is the navigation (which never changes) and the right frame is made up of two other frames. In these frames they place the content (ie. click menu item, app content is displayed here) and the bottom frame contains interval-type data.

The interval-type data frame makes this a pretty interesting choice because it switches between a few screens, such as a quick-view of the number of configuration errors found and a few others (which skip my mind right now).

Frames aren't dead yet, though they are slowly dying as modern design moves away from their downfalls.
I agree. Here's the link:
subject: Should I or should I not use frames
It's not a secret anymore!