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
Write a simple servlet program to print the contents of html.
What is the purpose of inter-servlet communication?
How printwriter is different from servletoutputstream?
What is the dispatcher servlet?
What is servlet in simple terms?
What are the life cycle methods of a servlet?
What is the disadvantage of cookies?
How many objects of a servlet is created?
What’s the use of the servlet wrapper classes??
When jsessionid is created?
Is servlet a server side scripting language?
What are the annotations used in servlet 3?
What is the difference between Servlets and Applets?
Differentiate between the get and post method
What do you mean by web applications? Explain web application directory arrangement?