How to prevent browser from caching the page content?



How to prevent browser from caching the page content?..

Answer / janet

Before sending the data to the browser,write the follwing code.
response.setHeader("Cache-Control","no-store");
response.setHeader("Pragma","no-cache");
response.setDateHeader("Expires",0);

Is This Answer Correct ?    4 Yes 1 No

Post New Answer

More Servlets Interview Questions

How to read request headers from servlets?

0 Answers  


What is the requirement of servlet config and servlet context implemented and how are they implemented?

0 Answers  


What is Server-Side Includes?

1 Answers   IBM, SAS,


Why doesn’t a servlet include main()?

0 Answers  


Explain the role of dispatcherservlet and contextloaderlistener.

0 Answers  


Whether we can get deadlock situation in servlets?

0 Answers  


What is a servlet-to-servlet communcation?

0 Answers  


program for RequestDispatcher in servlets?

3 Answers   Wipro,


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

0 Answers  


How do we go with database connection and log4j integration in servlet?

0 Answers  


What is ServletContext() and what is its use?

9 Answers   Prime Technology, TCS,


What is the advantage of Servlets when compared with other server side technologies?

0 Answers  


Categories