Explain saveToken() function

Showing Answers 1 - 6 of 6 Answers

DEBABRAT

  • Nov 24th, 2007
 

saveToken() method is used for duplicate form submission.
Let's take an example i.e. yahoo email registration form

You filled the form and press the "submit" button more than once.
For each action you do there is a request object associted with that.
So when you press the submit button twice that means you are sending
the same request twice so it will update the database twice which is an
overhead.

To check this struts have saveToken() along with isTokenValid()

When we send the request once to the server then we should disable that button otherwise the user may thought that the request is not sent so he send the request again and again. Here the problem is when we send the request for a normal pages for multiple times then nothing happens. But for bank applications if we send multiple times then improper action occers and we may get unrelated problems.

Here another problem is also be there i.e if it is a button then we are going to disaple it but if it is image as a button then what is the solution for this.

Thats why we are using saveToken() concept i.e when we send the request to the server for first time it is going to accept it and if we are sending multiple requests as like that then from second request onwards it stops executing the code.So only first request only it works.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions