Solved

Pagination

Posted on 2003-10-30
8
433 Views
Last Modified: 2008-03-10
Hi ,

Currently I am working on Struts.
I am working on a pagination code.
I have two hidden fields in my form namely 'next' and 'prev'.
I also have a <input type="image"> (for 'Next' and 'Prev'), on the click of which i set either of the two hidden fields to a value.
ON the server side, i check these values from request and take appropriate action.

The problem -
I click on the 'Next' image, and get appropriate action done. I get the expected output
page. Now if i press 'F5' or Refresh on the browser, on the server side the code written for
'Next' gets executed and instead of reloading the same page, it gives me the next expected page which is wrong. How do i stop this from happening ?

Thanks in advance...

Regards,
Janarthan S
0
Comment
Question by:janarthanasp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
8 Comments
 
LVL 35

Accepted Solution

by:
TimYates earned 500 total points
ID: 9648497
I use this with my struts app:

http://jsptags.com/tags/navigation/pager/index.jsp

it's really cool :-)  (and saved me all this sort of grief :-( )

Tim
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9648525
> How do i stop this from happening ?

Have you tried setting the redirect property on the ActionMapping for prev and next to "true"?

0
 
LVL 2

Expert Comment

by:f_98
ID: 9649019
i'd include another "index" hidden field just to ensure that everytime it executes a "next" command, it
starts off from this current index(of a list i suppose). (it is supposed to resubmit when you hit f5 anyway) so at least
it will keep on showing the same page. just like in google or other sites where you can see a start=x form element when you hit next
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 35

Expert Comment

by:TimYates
ID: 9649027
> (it is supposed to resubmit when you hit f5 anyway)

But you can get around this, by having the FormAction redirecting to the ViewAction...

then, refresh will just refresh the view, not resubmit data
0
 

Author Comment

by:janarthanasp
ID: 9649712
Hi Tim,

Thank you very much for the prompt response.
I am having a try with http://jsptags.com/tags/navigation/pager/index.jsp link that you gave. It looked like worth a shot.

Thanks again !!!
Regards,
Janarthan S
0
 
LVL 35

Expert Comment

by:TimYates
ID: 9649728
Hope it works for you :-)

It is really rather cool :-)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
arguments to jar 5 39
use lov values 2 72
servlet web applications   metadata-complete="true" or false 3 191
What is the use of Forwarding Class in java 1 35
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
The viewer will learn how to implement Singleton Design Pattern in Java.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question