What is the difference between servlet config and servlet context?

Questions by eldhose222

Showing Answers 1 - 2 of 2 Answers

namit

  • Aug 8th, 2006
 

Servlet context is used for the persistency of the data for the servlets within the same web application or within the same servlet engine.

So a particular data is common for all servlets sharing the same web application.

Whereas the servlet config is used to use a particular data for each servlet.

Other servlet in the web application cannot access the data obtained by servlet config of other user.  Servlet config is used to access the data for itself. Other servlet cant access others servlet config data.

  Was this answer useful?  Yes

Neeraj

  • Aug 19th, 2006
 

A servlet configuration object used by a servlet container used to pass information to a servlet during initialization.

Servlet context is used to communicated within web container. There is one servlet context per Application per JVM. Servlet Context is part of ServletConfig.

ServletContext = ServletConfig.getServletContext()

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Answer Question

Click here to Login / Register your free account


 
Send   Reset

 

Related Answered Questions

 

Related Open Questions