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
What is a servlet-to-servlet communcation?
What is servlet and list its types?
Can filter be used as request or response?
Describe some assignments that are executed by servlet container?
When is the servlet instance created in the life cycle of servlet? What is the importance of configuring a servlet?
How will you pass values from HTML page to the servlet?
What is the main purpose of java servlets?
What is called servlet mapping?
Describe servlet?
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
What are the difference between session and cookies in servlet? Explain
Are Servlets Thread Safe? How to achieve thread safety in servlets?
What is the process for chaining servlet?
What is the type of method for sending request from http server?
What is called servlet container?