Spring DI in servlet
Today, I'll show you how can inject a bean into your servlet.
thanks for sharing...
1. Using ServletContextListener
The
In your servlet :
ServletContextListener
will enable your servlets to access the Spring ApplicationContext
.In your servlet :
2. Using the SpringBeanAutowiringSupport
I personally prefer the following solution :
thanks for sharing...
Comments
Post a Comment