cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chitharanjan Das" <c...@accordiasys.com>
Subject RE: Object instanciation at cocoon startup
Date Mon, 10 Jun 2002 22:05:40 GMT

Create a new Servlet by name say InitServlet. Deploy this in the web.xml
of cocoon webApp.
Have the parameter 
<load-on-startup>1</load-on-startup> set to 1 as depicted.

Instantiate all the classes and store it the Servlet context. In the
init() function of InitServlet...

ServletContext servletContext = this.getServletContext();
servletContext.setAttribute(....,....);

When Cocoon starts up, the init function of InitServlet is called and
the logic defined in initServlet's it(ServletConfig config) method.
Ensure that U call the super.init(config) at the end of the method.


Hope this was useful...

Regds,
Chiths








-----Original Message-----
From: David LAGARDERE [mailto:dlagardere@yahoo.fr] 
Sent: Monday, June 10, 2002 3:43 AM
To: cocoon-users@xml.apache.org
Subject: Object instanciation at cocoon startup

Hello.

Sorry if this question does not deal directly with
cocoon.
I would like to know if it is possible to instanciate
some objects at startup and to store them in the
Cocoon Servlet context (like I would have done within
the init() method) so they can be available to all
sessions.

Thanks.

David LAGARDERE

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en fran├žais !
Yahoo! Mail : http://fr.mail.yahoo.com

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

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




---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Mime
View raw message