wood burning stoves 2.0*
The moose likes Struts and the fly likes Page Navigation + Back Button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Page Navigation + Back Button" Watch "Page Navigation + Back Button" New topic
Author

Page Navigation + Back Button

Aravind M Jay
Greenhorn

Joined: Mar 16, 2006
Posts: 15
Hi,

I have a JSP which shows a list of users. Each page is restricted to 10 records using pagination. My issue is -

Suppose I'm in the 3rd page and i click on the user name hyperlink i get the details of that user. I have a back button on this jsp page. So now when I click on this Back button i should go back to the 3rd page and not the 1st page. Right now it is redirecting me to the first page.

Is there any generic way which would work for all the JSPs?

I'm using Struts 1.2.

Thanks & Regards,
Aravind
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17258
    
    6

Moving this to the more appropriate Struts forum.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
There is no real generic solution that I know of. With a web app you only have 2 real places to store user specific data, the session or the request (not counting external storage like a database). Using request scope could get messy because you would have to store the page number as a hidden field on your details page. This might work if you are talking about 1 field (page number) for one detail page. This does not work well if you have lots of fields (sort by values, sort column, page number, etc.) or you have lots of different detail pages.

My general solution is to store a class that contains the search information for the search results on the session. Then when the search results page is refreshed it knows to look on the session to get the various search fields...including the current page number.

- Brent
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Page Navigation + Back Button