JSP Question:

Download Job Interview Questions and Answers PDF

How do I prevent the output of my JSP or Servlet pages from being cached by the browser?

Java JSP Programming Interview Question
Java JSP Programming Interview Question

Answer:

You will need to set the appropriate HTTP header attributes to prevent the dynamic content output by the JSP page from being cached by the browser. Just execute the following scriptlet at the beginning of your JSP pages to prevent them from being cached at the browser. You need both the statements to take care of some of the older browser versions.

Download Java JSP Programming Interview Questions And Answers PDF

Previous QuestionNext Question
How can I enable session tracking for JSP pages if the browser has disabled cookies? How do you restrict page errors display in the JSP page?