answersLogoWhite

0


Best Answer

ServletContext Defines a set of methods that a servlet uses to communicate with its servlet container.
ServletConfig is a servlet configuration object used by a servlet container used to pass information to a servlet during initialization. All of its initialization parameters can ONLY be set in deployment descriptor.


The ServletContext object is contained within the ServletConfig object, which the Web server provides the servlet when the servlet is initialized.
You can specify param-value pairs for ServletContext object in tags in web.xml file.


The ServletConfig parameters are specified for a particular servlet and are unknown to other servlets. The ServletContext parameters are specified for an entire application outside of any particular servlet and are available to all the servlets within that application.

By Santanu

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the difference between servletcontext and servletconfig?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Which class define the getWriter method?

servletcontext


How do you get ServletContext object in EJB - 38k?

get servlet context path from EJB


Generic Servlet and HTTP Servlet?

javax.servlet.GenericServletSignature: public abstract class GenericServlet extends java.lang.Object implements Servlet, ServletConfig, java.io.SerializableGenericServlet defines a generic, protocol-independent servlet.GenericServlet gives a blueprint and makes writing servlet easier.GenericServlet provides simple versions of the lifecycle methods init and destroy and of the methods in the ServletConfig interface.GenericServlet implements the log method, declared in the ServletContext interface.To write a generic servlet, it is sufficient to override the abstract service method.javax.servlet.http.HttpServletSignature: public abstract class HttpServlet extends GenericServlet implements java.io.SerializableHttpServlet defines a HTTP protocol specific servlet.HttpServlet gives a blueprint for Http servlet and makes writing them easier.HttpServlet extends the GenericServlet and hence inherits the properties GenericServlet.


Which method is used to retrive an initialitation parameters from a servlet context?

ServletContext sc=getServletContext(); String s=sc.getInitParameter();


What is difference between as on and as at?

difference between as on and as at


What are the differences between California and Florida?

What is the difference between Florida and California What is the difference between Florida and California


What is the difference between physician and doctor?

what's the difference between physician and doctorwhat's the difference between physician and doctor what's the difference between physician and doctor


What difference between paging?

Difference between paging and what?


What is the difference between an enterprise and association what is the difference between an pvt ltd and ltd.?

difference between enterprise and corporation


What is the difference between an enterprise and association what is the difference between an pvt ltd and ltd?

difference between enterprise and corporation


What is the difference between a samurai and shogun?

The difference between a shogun and a samurai is like the difference between a king and a knight.


What is the difference between difference and difference?

just difference