Ugh, that of course also sounds logical.

how would you do this, then?

Imagine you have a list of state codes (to keep it simple) that you
want to share across Sessions (imagine that's a really long list and
you dont want each session having a copy)

one more thing, I also have a service factory to work with, in which I
can instantiate "services" which are singletons that I can call
methods on... but here's where I get lost.

would I instantiate my service (singleton) in my struts plugin then call

Hashtable stateCodes = myService.getStateCodes();
getServletContext().setAttribute (stateCodes,"stateCodes");

? 

am I way off?


On Mon, 14 Feb 2005 13:22:58 -0600, Vic <[EMAIL PROTECTED]> wrote:
> Caching DATA in a view (Servlet) is a bad practice.
> 
> Best practice is to use DAO,
> A DAO does caching for you! It has fine grain control of how, when to
> flush, what size... all with no or minimal coding.
> 
> Data caching ...in Data Layer.
> 
> .V
> 
> David Johnson wrote:
> 
> >Hi All
> >
> >I have a need in an app I'm working on to cache data that is valid and
> >shared across users, like standard country codes, region codes,
> >industry codes... stuff like that.
> >
> >What's the best way to do that with my struts 1.2 application? Is
> >there something built in that I'm not aware of that I can leverage or
> >any best practices you guys can point me toward?
> >
> >Betst to ask the experts first...
> >
> >Thanks!
> >
> >D
> >
> >
> >
> 
> --
> Forums, Boards, Blogs and News in RiA <http://www.boardVU.com>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
-Dave
[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to