You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mitch Claborn <mi...@claborn.net> on 2009/07/08 17:31:27 UTC

caching Java objects

What is the preferred method of caching arbitrary Java objects locally
in a Struts application?  I've been making my actions implement
ApplicationAware and storing objects in that Map.  (I think this comes
from the ServletContext?)  Is that the best way or is there something else?

Mitch


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: caching Java objects

Posted by Oscar Alvarez <oi...@gmail.com>.
Hi...

It depends on what the objects mean on your system... exist
ApplicationAware, SessionAware and RequestAware interfaces...

You decide what to use in your design.

HTH

2009/7/8 Mitch Claborn <mi...@claborn.net>

> What is the preferred method of caching arbitrary Java objects locally
> in a Struts application?  I've been making my actions implement
> ApplicationAware and storing objects in that Map.  (I think this comes
> from the ServletContext?)  Is that the best way or is there something else?
>
> Mitch
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Atentamente
Óscar Álvarez Vielma
(09) 8416 4052

Re: caching Java objects

Posted by dusty <du...@yahoo.com>.
For stuff like data dictionary lists, or other random stuff I don't need to
reload I will initialize on startup and store in the servletContext.  I will
use EhCache for handling cache of model objects when I have a lot of reads
and want to improve performance when there are lots of "things".  

I think it depends on the scope of your need, but my guess is that you are
thinking about application-wide scope, so you are on the right track.  


Disclaimer: I have an irrational fear and allergic reaction to the HTTP
Session map, so I will do probably crazy things to avoid it.  



Mitch Claborn wrote:
> 
> What is the preferred method of caching arbitrary Java objects locally
> in a Struts application?  I've been making my actions implement
> ApplicationAware and storing objects in that Map.  (I think this comes
> from the ServletContext?)  Is that the best way or is there something
> else?
> 
> Mitch
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/caching-Java-objects-tp24393862p24403887.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org