answersLogoWhite

0


Best Answer

Hi to prevent the browser from cache. You have to implement the following code at top of the .jsp page.

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-cache"); //HTTP 1.1 response.setHeader("Pragma","no-cache"); //HTTP 1.0 response.setDateHeader ("Expires", 0); //prevents caching at the proxy server %>

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

It is possible to keep the browser from caching a JSP page's response data. The following hints added to the response header prevent most modern browsers from pulling pages out of cache when the same URL is "hit":

<%

response.setHeader( "Pragma", "no-cache" );

response.setHeader( "Cache-Control", "no-cache" );

response.setDateHeader( "Expires", 0 );

%>

The same effect can be achieved by using meta tags in the HTML header:

<meta http-equiv="Pragma" content="no-cache">

<meta http-equiv="Cache-Control" content="no-cache">

<meta http-equiv="Expires" content="Sat, 01 Dec 2001 00:00:00 GMT">

The Cache-Control header was added in HTTP 1.1, while the other two were also present in HTTP 1.0.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you clear the browser cache in jsp?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you clear the browser's cache on a computer downloaded with Windows7?

You can clear the cache by going in the settings. Search for history and cache and you can clear it from there.


How to Remove cache from browser using jsp?

By setting properties that prevent caching in your JSP Page. They are: &lt;% response.setHeader("pragma","no-cache");//HTTP 1.1 response.setHeader("Cache-Control","no-cache"); response.setHeader("Cache-Control","no-store"); response.addDateHeader("Expires", -1); response.setDateHeader("max-age", 0); //response.setIntHeader ("Expires", -1); //prevents caching at the proxy server response.addHeader("cache-Control", "private"); %&gt;


Why do you clear your browser's cache?

One would clear their browsers' cache if they wanted to be sure that they receive the very latest from the webpage(s) they are visiting.


How to clear the physical memory?

To clear physical memory in a computer, it is best to purge the Internet files in the browser. To do this, clear the browser's cache, which is typically listed under "options."


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

Add the following lines to your JSP: response.setHeader("Cache-Control", "no-cache"); response.setHeader("Pragma", "no-cache"); response.setDateHeader("Expires", -1); The first line works for HTTP/1.1 clients. The second line works for HTTP/1.0 clients. The third line will tell the browser the content is expired, so if the first two lines don't work, hopefully the third will.


How do you clear the computer cache when using the internet explorer?

In almost any internet browser, simply go to tools, clear history. or you can go to the settings and on the general tab will be a clear cache button.


What do you do when Farmville is not loading all the way?

Clear your browser cache, cntrl+shift+del while on your browser. then try again.


When you sign in badoo this error appear this page is temporarily unavailable how can you log in?

Clear your browser cache


How can you use the word cache in a sentence?

You should clear your browser's cache if things begin playing up.The cache of weapons was intercepted by the police.


How do we clear the browser cache in IE8?

HI Friend, this kind of problem arises due to technical fault,,you have to contact your known technical support man or as per you also can use this 24/7 toll free technical support number : 1-877-836-8352 .


Why won't my character load on Roblox?

If your character is not loading on Roblox try to clear your cache and cookies in the browser.


How can you join Skyrim after it shows the 'access denied' message?

Clear your browser cache, that should solve your problem.