Question :How do I prevent the output of my JSP or Servlet pages from being
cached by the browser? (JSP)
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.
<%
response.setHeader("Cache-Control","no-store"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader ("Expires", 0); //prevents caching at the proxy
server
%>
www.interviewhelper.org is a hope for all the Job seekers. Users can find unlimited here. These range from technical to HR, from functional to behavioral. www.interviewhelper.org contains in the fields like Ajax,VB,Networking,Sharepoint,JEE,Perl,Javascript,Bioinformatics,Classic ASP,Unix,Linux,Accounting,Oracle DBA,Microprocessor,Bluetooth,jms,jme,.net framework,ABAP,ASP,ASP.net,Basic .net Framework,Interview Questions,C language,C++,database,Oracle,Java,PHP,LAMP,SAP etc.
Friday, March 13, 2009
How do I prevent the output of my JSP or Servlet pages from being
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment