ServletContext (Interface)

  •  When we do deployment (manual), server will scan "webapps" folder and identifies the projects which is deployed. 
  • All the identified projects will be kept in Meta-space of server.
  • For every project which is deployed in 'Meta-space' automatically 'Servlet Context' object will be created. 
  • Context object can be accessed in the entire project, meaning in all the servlets of the project.
  • As this is the first object created after deployment. we can keep the database details like URL, username, password and we can retrieve when ever we required.  
  • For all the servlets in the project what ever the data is required, that data will be placed in the Servlet Context object. 
  • Servlet Context object will be destroyed when we undeployed the project.
  • We can keep parameter data and attribute data inside the Servlet Context object.
  • In web.xml, <context-params> will be placed under <web-app> because it will be accessible by all the servlets present in the project. 

Comments

Popular posts from this blog

Advantages and Disadvantages of Monolithic Architecture

Monolithic Architecture

Eclipse debugging