-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
We need to instantiate an object at the web server start that will be used from different web applications. We need to pick it from this different applications when we need to use it.
Does anyone knows how can we do it?
Thank you!
You should put into the Context... which AFAIK is shared among different web applications... but this is not ZK related ;)
@Steva77: a Context is defined per web-application, so it doesn't help if you want to communicate between different web-applications in a servlet container. Turn it the other way round: if a servlet container wouldn't shield one servlet context against another, I would call it a security problem...;-)
@Softteam: Can you describe your use-case? Sharing a common object between different web-applications sounds a little bit scary to me... although it's possible, but the problem isn't related to ZK at all.
First read:
No real solution is mentioned by the ZK-Team, so you'll see that you're doing something really unorthodox... you can achieve your goal by using a shared classloader & a singleton (e.g. in Tomcat):
http://pragmaticjava.blogspot.com/2009/01/tomcat-6-and-class-loading.html
Cheers, Maik
Hi Maik,
totally right: I confused with sharing information between sessions... I am getting old.
Your references are good indeed, thanks for sharing!
Asked: 2011-04-04 04:55:53 +0800
Seen: 117 times
Last updated: Apr 05 '11