I have used the following piece of code to retrieved an application ASO in a HttpSessionListener.sessionCreated method. It might work in ServletContextListener as well.
// context is the servlet context Registry registry = (Registry) context .getAttribute(ApplicationServlet.REGISTRY_KEY_PREFIX_PUBLIC + "(the name of ApplicationServlet given in web.xml"); ApplicationStateManager manager = (ApplicationStateManager) registry.getService("tapestry.state.ApplicationStateManager", ApplicationStateManager.class); MyApplicationObject myASO = (MyApplicationObject)manager.get("myApplicationObject"); HTH Shing --- Tapestry User List <[EMAIL PROTECTED]> wrote: > Hi, > > Happy new year !!!! > > I have created a class that implements > ServletContextListener. > In the method public void > contextDestroyed(ServletContextEvent event), > I need to retrieve an Application State Object (ASO) > of tapestry 4 > with an application scope (not session). > > My question is how to retrieve an Application State > Object (ASO) from > the ServletContext ? > > > public void contextDestroyed(ServletContextEvent > event) { > ServletContext context = > event.getServletContext(); > // retrieve myApplicationObject here > } > > In hivemodule.xml: > ... > <contribution > configuration-id="tapestry.state.ApplicationObjects"> > <state-object name="myApplicationObject" > scope="application"> > <create-instance class="ns.MyApplicationObject"/> > </state-object> > </contribution> > ... > > Thanks so much, > > D. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > Home page : http://uk.geocities.com/matmsh/index.html Send instant messages to your online friends http://uk.messenger.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]