0

Common resource reutilization

asked 2011-04-04 04:55:53 +0800

softteam gravatar image softteam
130 1 8

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!

delete flag offensive retag edit

3 Replies

Sort by ยป oldest newest

answered 2011-04-04 10:05:55 +0800

Steva77 gravatar image Steva77 flag of Italy
1014 3
http://www.research.softe...

You should put into the Context... which AFAIK is shared among different web applications... but this is not ZK related ;)

link publish delete flag offensive edit

answered 2011-04-04 14:35:02 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

@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:

http://books.zkoss.org/wiki/ZK%20Developer's%20Reference/UI%20Patterns/Communication/Inter-Application%20Communication

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

link publish delete flag offensive edit

answered 2011-04-05 02:27:17 +0800

Steva77 gravatar image Steva77 flag of Italy
1014 3
http://www.research.softe...

Hi Maik,
totally right: I confused with sharing information between sessions... I am getting old.
Your references are good indeed, thanks for sharing!

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-04-04 04:55:53 +0800

Seen: 117 times

Last updated: Apr 05 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More