| Author |
Why is this piece of code required from a servlet
|
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
Hai , i have see a lot of codings in which this piece of code is always present.
ApplicationContext context = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
Please tell me what is the use of this one .
|
Save India From Corruption - Anna Hazare.
|
 |
Freddy Wong
Ranch Hand
Joined: Sep 11, 2006
Posts: 959
|
|
You need it if you want to get the ApplicationContext from a servlet. Suppose you want to get a bean "myBean" from a servlet, then you need to do this.
Hope this helps.
|
SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
|
 |
Ravi Kiran Va
Ranch Hand
Joined: Apr 18, 2009
Posts: 2234
|
|
Thank you ver much Freddy (Federer )
|
 |
 |
|
|
subject: Why is this piece of code required from a servlet
|
|
|