How to create an object at application layer at start up time.

asked 2010-08-26 01:08:37 +0800

enricoge gravatar image enricoge
27 1 1

I need to create an object shared from all session (users) of my app. This object has to be created when the server starts.
Any suggestions ?

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2010-08-26 01:34:13 +0800

tomyeh gravatar image tomyeh
610 1 3
http://blog.zkoss.org ZK Team

There are a few ways.

1. Implement it in a static clause of a class that will be loaded at start up, if you can find such kind of class
2. Implement org.zkoss.zk.ui.util.WebAppInit, and register it to zk.xml as a listener
3. Implement a Http listener and register it to web.xml

link publish delete flag offensive edit

answered 2010-09-05 06:00:45 +0800

enricoge gravatar image enricoge
27 1 1

Thank you for the usafull suggestion. I will try

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




Asked: 2010-08-26 01:08:37 +0800

Seen: 267 times

Last updated: Sep 05 '10

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