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
How can the session in servlet can be destroyed?
Why are http servlets used in programming?
how the HTML data stored in web server?
What is the use of attribute in servlets?
What is the need of servlet filters?
Why HttpServlet class is declared abstract?
Why do we need servlet filter?
What are the functions of Servlet container?
What is the difference between context parameter and context attribute?
Explain the jar and war files in servlet?
Differentiate between the web server and application server?
What is the difference between the getrequestdispatcher(string path) method of javax.servlet.servletrequest interface and javax.servlet.servletcontext interface?
What are the uses of servlet
When using servlets to build the HTML, you build a DOCTYPE line, why do you do that?
In the servlets, we are having a web page that is invoking servlets ,username and password? which is checks in database? Suppose the second page also if we want to verify