What is the difference between servlet config and servlet
context.
Answer Posted / vkrishna88
ServletConfig:
1)An object of ServletConfig exists one per Servlet...
2)An object of ServletConfig will be created when
init(ServletConfig)method is executed...
3)The data to a servlet which related to ServletConfig
object must be written in <init-param>....</init-param> with
in <servlet>…</servlet> of web.xml....
4)An object of ServletConfig will exists as long as a
specific Servlet is executing.
ServletContext:
1)An object of ServletContext exists one per web application....
2)An object of ServletContext will be created when we deploy
the web application in servlet container or servlet
execution environment......
3)The common data or global data related to ServletContext
must be written under <context-param>…</context-param> with
in <web-app>....</web-app> and outside of
<servlet>...</servlet> of web.xml....
4)An object of ServletContext will exists until the entire
web application completed its execution.....
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is servlet invoker?
What methodology can be followed to store more number of objects in a remote server?
What is difference between jsp and servlet?
What is the life-cycle of servlets?
Tell the new features added in servletrequest interface i.e. Servlet 2.4
What is the major difference between servlet and applet?
Can we fetch the attributes related to a servlet on a different servlet?
What are all the advantages of servlet over cgi?
What do you mean by the servlet chaining?
How the typical servlet code look like ?
What is the servletconfig object?
How is an application exception handling is done using a servlet?
What is difference between cookies and httpsession?
What are different methods of session management in servlets?
What is httpservlet class?