Hy!

I have a bean on a jsp page (jsp:UseBean) , with application scope, that uses
some resources that must be freed when the application is stopped/reset.

I'm currently using a context listener to detect when does the servelt context
gets destroyed, but I cannot get the bean from it.

What I want to accomplish is:
1:public void contextDestroyed(ServletContextEvent e){
2:      ServletContext t  = e.getServletContext();
3:      myBean b =(myBean)t.getAttribute("newsbean");
4:      if(b!=null){
5:              System.out.println("Bean is:" 
+(b.holdsResource() ? "!ok" : "ok"));
6:      }else{
7:              System.out.println("No bean =(");
8:      }
9:}

where line 3 should do the trick. How can this be done?

Googling only turned up the reverse, accessing context from a bean,
and the listener is by the webapp in web.xml.

Thanks, nam3l3ss

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to