File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

two pages, single session bean problem

 
Gytis Jakutonis
Ranch Hand
Posts: 76
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm using managed bean from session scope to handle page data and actions. It is not clear how to handle situation, then the same client (single session) opens the same page in two browser windows with different data selected. Obviously session bean stores data for the last request only. So that happens on the first page submit (some action activated) - the only one session bean gets activated to handle the action. Action was activated from the first page, so user expects to get first page data submited. But session bean already contains data for second page, and submited action performs activities on that data. Is it possible to prevent such situation in JSF? Any ideas?
 
Andres Quinones
Ranch Hand
Posts: 57
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gytis Jakutonis:
Hello,

I'm using managed bean from session scope to handle page data and actions. It is not clear how to handle situation, then the same client (single session) opens the same page in two browser windows with different data selected. Obviously session bean stores data for the last request only. So that happens on the first page submit (some action activated) - the only one session bean gets activated to handle the action. Action was activated from the first page, so user expects to get first page data submited. But session bean already contains data for second page, and submited action performs activities on that data. Is it possible to prevent such situation in JSF? Any ideas?


I don�t know if I understand your problem, the only thing is that the session bean is the same for both browser windows beacause for you browser there is only one Session Instance. So if you modify data in the first window th second window shoul see that information. The way to prevent this I think is to change your bean to request scope, so every window can hava a different instance of that bean. I hope this will help.
 
Richard Green
Ranch Hand
Posts: 536
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
change the bean's scope to "request"
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic