We had the same problem. We created a static field (of the service type) in the HttpSessionListener and when the service was created (in buildService...) we assigned the service to the static field. We then could access the service from the HttpSessionListener via that static field.
Yes, it sucks, but we couldn't find any other solution as it seems impossible to get hold of the instance the servlet container creates. If anyone know how, please tell me.. 2008/2/28, anujith amaratunga <[EMAIL PROTECTED]>: > > Hi, > > I am trying to inject a service into a class which implements > HttpSessionListener, which is instantiated by the web container (jetty). So > I cant use the constructor or the on call methods sessionCreated() or > sessionDestroyed() to pass in a service, nor can I use the @Inject > annotation because its not a page, etc. > > It seems that HttpSessionListener is not bound to the JNDI or Servlet > context either. I was hoping that if I can get hold of the Listener instance > I can place the service I need using a setter, from a life cycle method on > the IOC container. No luck there. > > I've ended up trying to access the Registry from the HttpSessionListener > itself, so I can pull out my service. Is there a way to access the Registry > from a non page, non service class? > > thanks in advance, > > Anu > > -- > View this message in context: > http://www.nabble.com/t5-Inject-service-to-HttpSessionListener-tp15736395p15736395.html > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- /ted --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]