Old pages keep reloading after database info is changed

Hey everyone:

I'm having a problem here...

I have this database management thing done in pure servlet. There is a list of DB stuff, and then a button u can push to add info/delete an entry. So you add the new line or delete an entry, some DB updates are made, and then you are returned to the list using out.println("<script>parent.location='Admin?page=list'</script>");

This sends me back to the listing, but it is the old one before the new entry was added or one deleted. I have to click on the icon at the top of my page (to go to the listing) to get the updated list.

Any ideas? Is there some way to turn say never use a cached file or something?

Thanks,

Jeff

[736 byte] By [JeffMcLean] at [2007-9-26 2:33:40]
# 1

jeff,

why don't you try using the response.sendRedirect("URL here") function of the HttpServletResponse instead of an script. It could be that your script does not actually refresh you page, it only returns to your previous page without reconnecting to the server and to the database to get the new values.

Hope this one helps!

Cris

pulat85 at 2007-6-29 9:57:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

This is more then likely a problem with the browser caching the page. There are headers that you can set in the response for that page that will tell the browser not to cache the page.

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

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

there is another one that I cannot remember as well but these should work.

bobd3 at 2007-6-29 9:57:08 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...