LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-06-2008, 03:02 PM   #1
perry
Member
 
Registered: Sep 2003
Location: USA & Canada
Distribution: Slackware 12.0
Posts: 978

Rep: Reputation: 30
How to clear the web browser cache?


I am doing an web application over https that needs to clear the web browser cache after the transaction is completed. It's a credit card application. Hence you should realize what it is that I need to do.

Does anyone here have any JSP, Java experience with servlets and Tomcat and can tell me what to look out for ? Is there something that I do with the request or response parameters in the servlet that will cause the browser not to cache any information. If so and it is obvious to you, please feel free to point it out to me, it'll be greatly appreciated.

Thanks

- Perry

ps.
Thanks again moderators! The application is being developed and deployed on Linux servers.

Last edited by perry; 03-12-2008 at 06:37 AM.
 
Old 03-06-2008, 06:20 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by perry View Post
Moderators Please Have Mercy on Me
Why? You haven't violated the LQ Rules (yet)? ;-p


Quote:
Originally Posted by perry View Post
clear the web browser cache after the transaction is completed.
client side cache means client side action, period.


Quote:
Originally Posted by perry View Post
Is there something that I do with the request or response parameters in the servlet that will cause the browser not to cache any information.
http://www.linuxquestions.org/questi...9/#post3017638 ?
 
Old 03-08-2008, 02:30 PM   #3
perry
Member
 
Registered: Sep 2003
Location: USA & Canada
Distribution: Slackware 12.0
Posts: 978

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by unSpawn View Post
Why? You haven't violated the LQ Rules (yet)? ;-p



client side cache means client side action, period.



http://www.linuxquestions.org/questi...9/#post3017638 ?

i figured it out after but thanks! i knew i would find something on this board related to my problem, i almost always do

thanks again

- perry
 
Old 03-09-2008, 06:26 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Well, then post your fix.
 
Old 03-10-2008, 12:43 PM   #5
perry
Member
 
Registered: Sep 2003
Location: USA & Canada
Distribution: Slackware 12.0
Posts: 978

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by unSpawn View Post
Well, then post your fix.
You place meta tags in your html file. Perferably in two locations;

Code:
<head>
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</head>
<body>
...
</body>
<head>
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
</head>
It seems odd to have two <head> sections but thats what they say to do.

It doesn't clear out the cache as hoped but does clear off anything the user may have entered. Which is good enough for me at the moment.

Thanks

- Perry
 
Old 03-10-2008, 01:12 PM   #6
perry
Member
 
Registered: Sep 2003
Location: USA & Canada
Distribution: Slackware 12.0
Posts: 978

Original Poster
Rep: Reputation: 30
Thumbs up How to add your own Tomcat certificate to your JVM!!!

In a totally related story, I had to create my own self-signed certificate for development purposes. This I found off the apache website for tomcat. There I found out the hard way all about the keypass= option (if you screwed up with the password you have to specify your password using keypass="yourpassword" in the connector under server.xml).

Code:
$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA
That was the easy part. Realizing that my .keystore file was located under My Documents (in Windows) was another.

It was here that I soon faced a problem. That is, how to do a form post. The browsers I was using could interface with localhost:8443 sure enough, however when I tried to access it with a Java program to do a form post, I ran into a SSLSecurityException. It seems there is no pop up windows in the world of stand alone Java as opposed to the option the browsers give you.

To properly deal with this problem, I was pleased to find out that I simply had to export my self-signed keystore:

Code:
keytool -export -alias tomcat -file tomcat.cer
Then I imported it into my JVM (first I had to check to make sure I was using the correct one as I have four different installations of Java on my machine):

Code:
keytool -keystore \java\jdk1.5.0_14\jre\lib\security\cacerts -import -alias tomcat -file tomcat.cer -trustcacerts
When prompted, use the password "changeit".

I honestly didn't think that I would have found a solution today, but I did. Just had to come here and post it.

Have you had your Java Today?

- Perry

Last edited by perry; 03-10-2008 at 05:28 PM.
 
  


Reply

Tags
certificates, java, tomcat



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how do you clear the cache? eagletalontim Linux - Newbie 11 01-11-2006 03:05 PM
Help! Clear web.cache and log files on server DogByte Linux - Newbie 1 09-20-2005 06:51 PM
how cache works in w web-browser gajaykrishnan Linux - Networking 4 08-13-2004 12:48 PM
Emptying Internet cache under Konqueror web browser piggysmile Linux - Software 2 05-25-2004 04:31 AM
web browser clear history bentbike1 Linux - Software 1 01-26-2004 08:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration