• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Browser back/forward problem

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I wanted to know are there any cases where when you click on browser back/forward button it makes a call to the server? I am really surprised to see the page submission happening whenever browser back/forward button is hit in our application.

I am working on an application which has been implemented in Struts(DispatchAction concept), Tiles. As far as my knowledge is concerned, browser buttons never make a call to the server, instead all the visited pages are just pulled from cache and displayed but my application is behaving quite opposite way, it makes a call to the server on every hit on browser-back/forward buttons and results in an inconsistent behaviour.
After searching for quite sometime, i found these lines :
Another issue is caching pages when browsers navigate backwards --
browsers are more likely to silently re-submit a form request with a GET method than with a POST request.

source:
http://lists.nyphp.org/pipermail/talk/2003-February/002327.html

Do you think the problem is with the request submission or in usuage of Struts Dispatch Action?

Can someone help?
TIA
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Devi", you have previously been warned on multiple occasions regarding adjusting your display name to meet JavaRanch standards. This is not optional, and this is your final warning. Adjust your display name to comply with the required standards prior to your next post.

Your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Failure to comply will result in the removal of your account.

bear
JavaRanch Sheriff
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Devi:


I wanted to know are there any cases where when you click on browser back/forward button it makes a call to the server?




As far i know.. the Answare is YES. i did experiment on this recently...i found that when you paste some code like



to prevent browser cache ... then if you click back/forward button...it reach server...

you can not disable browser back button but you can controll.


then what you read from the link which you gave is correct... always use POST method to submit the forms
 
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To add one more point, the "GET" request should not "Modify the State", it means even if you request for multiple times the state should not be modified and hence will not lead to inconsistencies....

Hence, if you are doing a FORM submissions, you better use "POST" as it modifies the "State".

HTH
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic