aspose file tools*
The moose likes Struts and the fly likes Multiple browser windows corupting sessions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Multiple browser windows corupting sessions" Watch "Multiple browser windows corupting sessions" New topic
Author

Multiple browser windows corupting sessions

Sri Anand
Ranch Hand

Joined: Mar 06, 2005
Posts: 392
the application i am currently working on sessions are getting corrupted, when users opens multiple browsers to copy past data, the problem getting worst due to forms being in session scope are rewriting the wrong records.

We are using struts1.1 will struts token resolve this issue ? what are other ways to solve the problem
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9319
    
  17

Although you've not provided enough information to find a solution, but with the available information, using Request scope for form beans seems a solution...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Sri Anand
Ranch Hand

Joined: Mar 06, 2005
Posts: 392
What we are using is exactly this !!
http://struts.apache.org/1.x/struts-extras/dispatchValidator.html

The actual problem is user is opening 2 browser instances; when he is filling in the applicaiton form and session of one instance is getting into other this rewriting some wrong records
Sri Anand
Ranch Hand

Joined: Mar 06, 2005
Posts: 392
Sri Anand wrote:What we are using is exactly this !!
http://struts.apache.org/1.x/struts-extras/dispatchValidator.html

The actual problem is : user is opening 2 browser instances ,opening a old and new applications; when he is filling in the new application form, session of old applicaition is overriding the new applicaiton instance and modifying the wrong records
. infact when multiple browsers are opened like this session of last one is taking prcedence over others !!!

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

That's just how sessions work--if you want to allow multiple conversations on the same session there are some frameworks that provide this (I'm thinking primarily of Seam), although I suspect its techniques could be adapted.
Sri Anand
Ranch Hand

Joined: Mar 06, 2005
Posts: 392
You mean if i use request scope even then i will come across this problem ? Will struts tokens be of any use here
Sri Anand
Ranch Hand

Joined: Mar 06, 2005
Posts: 392
I put struts tokens on all pages where i add or edit the record; on each page action( for both previous and next) i have save token and checking for the token in the next action; if session were cloned and user is trying to work on multiple sessions or user used CNTRL +N tokens don't match user is sent to error page.
looks good with IE8,IE6,IE7.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multiple browser windows corupting sessions