• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

When to Load Banner URL

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
If a regular clown is funny, then a larger clown would be funnier. Math. Verified by this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic