• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

When to Load Banner URL

 
Cory Max
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Thanks,

Cory
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Joan Horta Tosas
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also store it in a session variable.

If nobody overrides this atribute, it will be available from anywhere in the same session.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic