This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
The moose likes JSP and the fly likes back and reload Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "back and reload" Watch "back and reload" New topic

back and reload

Sangeetha Rao
Ranch Hand

Joined: Aug 01, 2005
Posts: 33
I have a page PAGE1.jsp that has a table of names from the database. The page also has a text box in which the user can enter a name and submit. Once the user submits, the flow goes to a servlet that inserts the data in the database table and gets forwarded to a confirm.jsp page that displayes a confirmation message.

I want a link/button on confirm.jsp that takes me back to PAGE1.jsp which has the latest set of names. i.e I want a back and reload functionlity. How do I do that?

history.go(-1) and history.back() just go back to PAGE1.jsp but they dont refresh the page. I have to manually refresh to get the latest data in that table. How can this be prevented?
Pankaj Patel
Ranch Hand

Joined: Jul 13, 2006
Posts: 73
Hi. Instead Of using history.back() or history.go(-1), Put a link to page1.jsp, or refresh that confirm.jsp page after few seconds and in refresh meta tag give url of page1.
Sangeetha Rao
Ranch Hand

Joined: Aug 01, 2005
Posts: 33
I cannot hard code the link to page1.jsp in confirm.jsp because confirm.jsp is a common page used by many pages to display a confirmation information.

Is there a way to get the URL of page1.jsp at runtime?
I agree. Here's the link:
subject: back and reload
It's not a secret anymore!