tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig O'Brien" <cr...@thebridgeproductions.com>
Subject RE: I don't want cached pages
Date Fri, 19 Jan 2001 19:29:09 GMT
Add these two lines to your Servlet or JSP:

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

Not guaranteed to work in every browser.

Regards,
Craig


-----Original Message-----
From: Hugo Lara [mailto:hugo.lara@alterbrain.com]
Sent: Friday, January 19, 2001 11:12 AM
To: tomcat-user@jakarta.apache.org
Subject: I don't want cached pages


I'm developing a website using Tomcat but I have a little problem.

I use a page that calls itself passing some parameters and based on the
parameters passed shows certain result.
The first time I call the page the URL looks like this:

http://myHost:21968/Demos/Formating.jsp

and I get the "original page"
After calling itself with a parameter, the URL look like this:

http://myHost:21968/Demos/Formating.jsp?parameter=123

and I get the "result page"
If I try to get the original page typing
http://myHost:21968/Demos/Formating.jsp in the browser, what I get is the
last page showing a result. It happens even if I call the page from a
different computer.

This is a serious problem because it means that someone accessing the site
for the first time, would see the result page generated by the parameters
passed by the last visitor instead of the original page.

The only way I've found to solve this is restarting Tomcat's service. Doing
so I won't get the result page but the original page.
But of course, I don't want to be restarting Tomcat's service everytime a
visitor wants to access the site.

Does anyone have a solution to this problem?


Mime
View raw message