You beat me to punch Wendy, I was just in the middle of tying almost the
same reply :)
The only complication in such situations to be aware of is when you
might need to periodically refresh the data, i.e., maybe the database
could possibly be updated throughout the day, but not frequently enough
to hit it every time through.
Depending on the requirements, it might be better to simply have a
helper class that returns a bean with the data, and call that where
appropriate in the application. There are performance implications to
that of course, and of course the extra code (albeit trivial)
throughout, so that needs to be balanced against the frequency of data
updates.
Also, depending on how much data your talking about, if you truly do
need it in session scope, be aware of the implications for scalability.
The more you put in session, the worse the scalability of your app,
generally-speaking.
Frank
Wendy Smoak wrote:
From: "Rafael Taboada" <[EMAIL PROTECTED]>
I need to store some objects in session scope in order to use
around the application.
If you need to use them across the entire webapp, then application/context
scope might be more appropriate. But either way, what I do is have a
Listener that is notified when the app (or a session) starts. I put various
Maps and Lists into the appropriate scope under known keys, and then they're
there to be used whenever I need them.
Take a look at HttpSessionListener or ServletContextListener depending on
what you decide you need.
--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]