What is ServletContext() and what is its use?
Answer Posted / telo
Data saved in a ServletContext scope is shared by all
servlets and JSPs in the context. The data stored in the servlet
context is destroyed when the servlet context is destroyed.
//save and get an application-scoped value
getServletContext().setAttribute(“application-value”,
“shopping-app”);
value = getServletContext().getAttribute(“application-value”);
| Is This Answer Correct ? | 28 Yes | 9 No |
Post New Answer View All Answers
Explain the difference between a web server and a web container?
Explain the methods of request dispatcher in servlet?
What is servlet collaboration?
Explain the jar and war files in servlet?
What is the type of method for sending request from http server?
What do you mean by servlet?
What are the functions of Servlet container?
Why session tracking is needed?
What are the different mode that servlets can be used?
What is the difference between 2 types of servlets?
What is a servlet context object?
Write a hello world program using servlets.
What is cookies in servlet with example?
What do you mean by deployment descriptor?
Explain web application directory arrangement?