Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet context and servlet container

 
rajaraman navaneethan
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi friends,
i have just started working on servlets.can u people explain me what is servlet context and wat is servlet container.

regards,
raja
 
Rajesh Tarigopula
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi raj,
ServletContext is a container to hold application lever info.
Pls go through the java specification once.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pandoo Go:
Hi raj,
ServletContext is a container to hold application lever info.
Pls go through the java specification once.


Why Java specification ?

http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletContext.html
 
Atul Agarwal
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Raja,

ServletContext interface provide a place to hold information that can be share with all the Servlets & JSPs in an application. It intializes at the time of server startup with the values decalred in the Deployoment Descriptor.
Its better to call Web Container instead of Servlet Container, which holds all Servlets and JSPs(later converted to Servlets) instances. Also web container takes care of life cycle of each servlet and provide call back methods for servlets.

Regards,
Atul
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic