File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes When to Load Banner URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "When to Load Banner URL" Watch "When to Load Banner URL" New topic

When to Load Banner URL

Cory Max
Ranch Hand

Joined: Jul 20, 2005
Posts: 83
OK Ranchers,

Here is my problem: When my app is first loaded I would like to get the url for the banner image from a database. I do this because different banners are being used for different user groups. Getting the image based on the user is no problem.

My problem is that the banner is displayed on every page. If I want to display it on every page, I'd have to put the url for the image in every action form, or in one action form with session scope wouldn't I? I would like to keep my action forms request scope, and don't think putting the banner url in every action form is the right idea. Can someone clue me in? The problem seems reasonably simple, but could really use some insight from the pros.



There are only 10 types of people in this world... Those who understand binary and those who don't.
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
This would be a good place to use Struts Tiles. With tiles you can define a template that includes a header area that would contain your banner and a body area to contain the rest of the page. Check out this link and see if tiles is a good fit for you.

Consultant, Sima Solutions
Joan Horta Tosas
Ranch Hand

Joined: Feb 01, 2007
Posts: 59
You can also store it in a session variable.

If nobody overrides this atribute, it will be available from anywhere in the same session.
I agree. Here's the link:
subject: When to Load Banner URL
It's not a secret anymore!