File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Using session or request, in Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Using session or request, in Struts" Watch "Using session or request, in Struts" New topic
Author

Using session or request, in Struts

Sean Li
Ranch Hand

Joined: Feb 27, 2002
Posts: 154
In my app, I have some kind of jsp pages may be accessed from different entries, should I use session or request as the scope of form bean?

for instance, I have a order select screen. this page can be accessed from purchase order selection and sales order selection and etc. If I set the order select form bean into session, I will be in trouble if two order selection screen opened at the same time.

but if I don't set the form bean into session, and use request instead, it would be hard for me to remember the purchase order form bean or sales order form bean.

I'm sure most of you have the same problem, how did you handle it?
Andy Deighton
Ranch Hand

Joined: Apr 01, 2003
Posts: 39
"I will be in trouble if two order selection screen opened at the same time" - how would this be achieved? By opening two browsers? I thought by opening two browsers, you'd get two sessions, and your form bean would be safe.
Alternatively, you could keep your form bean as request scope, but put whatever other information you need in your session scope - this can then be accessed from your actions.

Andy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using session or request, in Struts