Questionsforum
What is difference between servlet config and servlet context?

What is difference between servlet config and servlet context?



On 2014-06-12 07:39:56.0
brajeshkumar


init() method is the life cycle for every servlet and ServletConfig instance is initialized using init(ServeltConfig cfg) that means ServletConfig object is created for every servlet. 
ServletContext is created once and one time by the web container for the entire Application. 
  1. Scope of ServletConfig is within their servlet only where are scope of ServletContext is for the entire application.
  2. ServletContext is created at the container start-up where as ServletConfig is created after creating the instance of our Servlet class.


On 2014-06-12 08:35:15.0
sushant

copyright@questionsforum.net