Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doubt about servlet context

 
challa
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Can anyone please tell how retrieve servlet context object?
 
Sergey Tyulkin
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can retrieve ServletContext object by ServletConfig.getServletContext() method.
The ServletConfig object is passed to the init() method of the servlet.
More over, GenericServlet itself implements ServletConfig interface, and you can simply cal getServletContext() method as is in you servlet methods (doGet, doPost an so on)
 
challa
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic