Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why is this piece of code required from a servlet

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .
 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you ver much Freddy (Federer )
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic