Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: Refreshing data


Message #1 by "Johan Ruttens" <ruttens_johan@h...> on Thu, 17 May 2001 12:50:14
You say you restart the server to see the updated data. Here's a simpler
possibility: if you simply refresh the page showing the list of data (using
the browser refresh or reload button), does it then show the updated data?

If so, then it's simply a problem of the browser caching the results of the
previous view of the list page.

This problem, of course, has nothing to do with JSP. It's both a browser and
a programmer problem. I say a browser problem, because browsers can be set
to indicate how often they check to see if a page in the cache has been
updated. In IE 5, under Tools>Internet Options>General>Temporary Internet
Files>Settings, there is a radio button group labelled:

Check for newer versions of stored pages:
-every visit to the page
-every time you start IE
-automatically
-never

Of course, you can't control what your users settings will be, nor can you
expect them to be any of these (I think the default is "automatically",
which may not work for dynamic pages such as those from JSP).

The alternative, then, is for you to programmatically indicate to the
browser that you want the page to not be cached. There are a variety of
options for that, and they change depending on the browser and version. Look
into META refresh and expires tags, the pragma no-cache header directive,
and similar solutions.

Of course, if you refresh the page and it still doesn't change the list to
represent the changed data, there may be other problems (database driver
issues, timing of commit of changes to the DB, and more).

Perhaps others will offer ideas.

/charlie

-----Original Message-----
From: Johan Ruttens [mailto:ruttens_johan@h...]
Sent: Thursday, May 17, 2001 12:50 PM
To: Pro_JavaServer_Pages
Subject: [pro_jsp] Refreshing data


Hi (again),

I've made a list with data of users (their number and their name) when a
want to change, delete or add a record to the list I push a button and
fill in the necessary data.  It all works but after I return the is list
isn't up to date with the new altered data.  After I restart my JSP
everything is up to date.

How can I resolve this problem?

Thanks in advance

  Return to Index