Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Page Navigation + Back Button

 
Aravind M Jay
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the more appropriate Struts forum.

Mark
 
Brent Sterling
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic