Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to do this?

 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have an application developed as per MVC architecture using JSP, Servlet and JavaBeans.

I have a single controller that handle request from user.

Now I want to implemented logic that detect
(1)Refresh
(2)Back
(3)Multiple Submit

How to do this?
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Requesting for the page and refresh has no distinction at the server.

Back button mostly function from browser proxy, if not then it is also the same as sending a request.

Yeah, but for multiple submit, like if user press a button multiple times, there is a way to control that.
http://www.onjava.com/pub/a/onjava/2003/04/02/multiple_submits.html
[ November 21, 2005: Message edited by: Adeel Ansari ]
 
Stefan Evans
Bartender
Pie
Posts: 1670
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another possibility would be to use the synchronizer token pattern.
http://www.javaworld.com/javaworld/javatips/jw-javatip136.html

Basically you issue a "token identifier" to each page, so you can detect duplicate submissions/refreshes.
 
Vishnu Prakash
Ranch Hand
Posts: 1026
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic