• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 143
  • Last Modified:

Need Caching in IE 6.0

Hi
   One of the screens in our application requires caching. i.e. User will enter data in input screen & click "Create" button. The data will be submitted to the server and re-displayed in the same screen with the previously entered (We havent done anything programmatically to re-display the data).  We've coded for no-caching in an include file and included it in all the pages. Because of the above requirement, the above jsp overrides no-caching by using the following

      response.setHeader("Cache-Control","store");
      response.setHeader("Pragma","cache");
      response.setDateHeader("Expires", 20160);

This works fine. The data is re-displayed after the user clicks create.  

The screen contains a button that will invoke another pop-up screen that will fill one of the fields in the base screen. Once the pop-up screen is invoked and closed, the caching technique doesn't work. i.e. the data is not re-displayed after clicking "Create" button. This problem occurs even if a blank page is invoked in the pop up window.

Is there any possible solution to overcome this?

Note:-  In Mozilla, the data is automatically cached even without the above three lines. i.e. it re-displays the data after clicking "Create" . It works fine even if the popup window is invoked. Hence, the user community wants the same behavior in IE too!!!!

0
athuranand
Asked:
athuranand
1 Solution
 
Ryan ChongCommented:
Require caching? Why dont just simply remove those 3 lines above?..
0
 
athuranandAuthor Commented:
If the above three line are removed, then caching wont happen.
0
 
copyPasteGhostCommented:
I would use a java bean

load all the values you want into a java bean and then load them from the bean on to your page.. you can keep the same variables for the whole session..

when using beans 3 things to keep in mind.

1)   you need a package.
      add this statement to all your .java files.
      package myPac;

2)   you must declare this at the top of your .jsp page.
      <jsp:useBean id = "tracking" scope = "session" class = "myPac.myClass" />

3)   You must be using this directory structure

-jspfiles
-WEB-INF
          -classes
              -myPac
                   -myClass.class

I can explain this futhur if you are not familiar with java beans..
let me know and I'll get back to you as soon as possible.
Cheers
Ghost
0
 
athuranandAuthor Commented:
Hi Ghost
   Thanks for your reply. I'm faimiliar with java beans and also reloading technique using beans. I'm just trying to satisfy some requirements on already existing code. Moreover this page is being reused and dynamically generated depending upon the type of entity. So, using beans at this stage doesnt work. But thanks for your reply.
0
 
KartikShahCommented:
Normally, you are on the mercy of the browser, what data it displays in the form fields. i.e. the browser, can either display the last values posted, or the default values associated to each field i.e. the value present in the value attribute, which in your care is empty.

If you want to provide a consistent output, irrespective of the browser's decision, I would suggest you, you can load the page again, with the submitted values as the default values.

This will give confidence, that irrespective of the browser being used, the functionality will be the same. :)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now