Java Mailing List Archive

http://www.gg3721.com/

Home » users.tapestry »

How to Inject Servlet Context into My Services Using T5 IoC

Rui Tang

2010-08-28

Replies: Find Java Web Hosting

Author LoginPost Reply
Hi there,

I'm using T5 IoC independently.

I'm developing a web application and having a ServletContextListener to
handle the webapp startup event. In this event, I use IOCUtilities to build
a registry. And then all services are defined. But in some of the services,
I want to inject the servlet context into it in order to get some
configuration parameters, but I found that can't (maybe I'm wrong) in the
way of using module build methods or contribution methods. According to the
tapestry-spring module, I find a ModuleDef type seems help. I want to know
if this is the common way to do this? Or should I use some other ways. Some
simple examples would be very appreciated.

Thank you!

--
唐睿
©2008 gg3721.com - Jax Systems, LLC, U.S.A.