cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <va...@reverycodes.com>
Subject Re: Old-style ApplicationContext crashes the system
Date Thu, 27 Mar 2008 17:46:58 GMT
On Mar 26, 2008, at 7:05 PM, shai200 wrote:
> However, for some reason the program crashes when it initializes the
> ApplicationContext:
>
> ApplicationContext.setAppContext(sce);
> where sce is a ServletContextEvent passed as a parameter to the
> contextInitialized method.

You probably should provide more information. What 'crashes' mean? I  
presume that is not a BSOD you are getting :)


> To keep a long story short, I'm trying to achieve the goal of storing
> objects on the application level (and having them initialize when  
> the web
> server starts) by adhering to the standard Cocoon way (perhaps through
> Spring? I'm not sure how that is done).

Through Spring, you'd create your java class, which does the pre- 
loading of data and storing that data in member variables. Usually  
you'd do this in initialization method. Next, you register this bean  
in spring's xml file, and that's it: Spring will load this bean on  
startup, initialize it, and it will preload all the data. After that,  
you can just lookup this bean in any place you need, and call its  
getter methods to retrieve preloaded information. That would be a  
'spring' way.

Vadim

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message