View Full Version : Spring with raw servlets
hubaghdadi
Jul 12th, 2007, 02:23 PM
Hi.
My application uses JSP and raw servlets.
Can I use Spring to inject dependencies inside the servlets?
Thanks.
Marten Deinum
Jul 12th, 2007, 03:23 PM
Injection into your Servlets is going to happen I'm afraid. You can however do a dependency pull. Register a ContextLoaderListener and then from within your Servlets init method retrieve the ApplicationContext and pull the beans you need from there.
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.