File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Go back to previous page 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 » Frameworks » Struts
Bookmark "Go back to previous page" Watch "Go back to previous page" New topic

Go back to previous page

Michael Stains

Joined: Mar 07, 2008
Posts: 5
In an updateable page I provide a Cancel button which cancels the update and re-displays the previous page. I can think of 3 ways of doing this:

1 - Java Script in the button to 'go back' to the previous page.
2 - Code a complete re-display of the previous page including retrieveing data from the database.
3 - As for 2 but use data previously stored as Session attributes.

Is there a better way of doing this ? Which method conforms to Struts best practice ?

Thanks for your help.

Michael Stainsbury
vaibhav maddiwar

Joined: Jun 13, 2008
Posts: 21
3rd way is looking good to me. You can store the information from DB into cache and take the data from cache if its not empty.

I agree. Here's the link:
subject: Go back to previous page
It's not a secret anymore!