• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

About the Data which has been set up in Request Scope

 
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Think of a scenario if i set soe data in request scope and if the user presses the back button will the data inside the request scope still exists ??

 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I understand the situation you are trying to describe, no.

Request scope only covers a single request.

If the client abandons that request -OR- if the request completes and the response is sent, thats the end of it.

Bill

 
PavanPL KalyanK
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

William Brogden wrote:
If the client abandons that request -OR- if the request completes and the response is sent, thats the end of it.



Is clicking the browser back button will fall under the specified list??

Becuase i think that (Clicking the back button) will be not considerded as a Request .

(I think data which is set in a request scope will be there even if he/she clicks a Back button of browser.

Any suggestions.
 
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

PavanPL KalyanK wrote:

Becuase i think that (Clicking the back button) will be not considerded as a Request .



Yes . [but if you prevent browser cache , the request get call on server side . i see this behaviour in tomcat]


PavanPL KalyanK wrote:

(I think data which is set in a request scope will be there even if he/she clicks a Back button of browser.



Here you confused with Browser Cache !
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But i have observed that clicking back button will make another request to server.
I am really confused .Can anybody clear this doubt with some meaning ful explanation?
 
Seetharaman Venkatasamy
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

Surya Kant wrote:But i have observed that clicking back button will make another request to server.



Well, for that you need to prevent the browser Cache .otherwise it wont be happen
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The exact behavior on clicking the back button depends on many things - in addition to cache control, there may be JavaScripts on the page activated by the page being re-displayed and any number of other possibilities. You can't rely on all browsers behaving exactly the same way.

In any case, the first request is gone, long gone. It is up to you the programmer to correctly handle any data you want to keep.

Bill
 
Arthur, where are your pants? Check under this tiny ad.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic