aspose file tools*
The moose likes Servlets and the fly likes About the Data which has been set up in Request Scope Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "About the Data which has been set up in Request Scope" Watch "About the Data which has been set up in Request Scope" New topic
Author

About the Data which has been set up in Request Scope

PavanPL KalyanK
Ranch Hand

Joined: Feb 28, 2009
Posts: 212
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 ??

William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
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

Joined: Feb 28, 2009
Posts: 212
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.
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

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 !
Surya Kant
Ranch Hand

Joined: Mar 29, 2005
Posts: 104
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

Joined: Jan 28, 2008
Posts: 5575

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
Rancher

Joined: Mar 22, 2000
Posts: 12769
    
    5
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: About the Data which has been set up in Request Scope