Re: Session-scoped form and synchronization...

2003-10-27 Thread Kris Schneider
Nope, don't think so.

Quoting Bob Lee [EMAIL PROTECTED]:

 Does Struts synchronize on session-scoped forms? For example, can I 
 assume that Stuts won't modify the fields on a session-scoped form in 
 response to one request while an action is still using it?
 
 Thanks,
 Bob

-- 
Kris Schneider mailto:[EMAIL PROTECTED]
D.O.Tech   http://www.dotech.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Session-scoped form and synchronization...

2003-10-27 Thread Bob Lee
I assume this is a bug then, because there's no way for me to do this. 
It has to be done within Struts.

Bob

Kris Schneider wrote:

Nope, don't think so.

Quoting Bob Lee [EMAIL PROTECTED]:

 

Does Struts synchronize on session-scoped forms? For example, can I 
assume that Stuts won't modify the fields on a session-scoped form in 
response to one request while an action is still using it?

Thanks,
Bob
   

 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Session-scoped form and synchronization...

2003-10-27 Thread Manish Singla
hmmm. may be this not an bug...as struts ActionServlet extends  Java 
Servlets .
And Java Servlet is not not thread safe

FYI: same goes for application attributes..



Bob Lee wrote:
I assume this is a bug then, because there's no way for me to do this. 
It has to be done within Struts.

Bob

Kris Schneider wrote:

Nope, don't think so.

Quoting Bob Lee [EMAIL PROTECTED]:

 

Does Struts synchronize on session-scoped forms? For example, can I 
assume that Stuts won't modify the fields on a session-scoped form in 
response to one request while an action is still using it?

Thanks,
Bob
  


 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
Thanks
Manish Singla
x73166
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Session-scoped form and synchronization...

2003-10-27 Thread Peter Abbot
Generally if you are using a browser based interface to execute a
servlet requests (except if using frames) the user can only send one
request at a time. So if you are using a action with a session form and
another action wants to use that form means that the user doesn't want
the result of the previous request that might still be using the form.

Pete

-Original Message-
From: Manish Singla [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 28 October 2003 8:25 a.m.
To: Struts Users Mailing List
Subject: Re: Session-scoped form and synchronization...


hmmm. may be this not an bug...as struts ActionServlet extends  Java

Servlets .
And Java Servlet is not not thread safe

FYI: same goes for application attributes..



Bob Lee wrote:
 I assume this is a bug then, because there's no way for me to do this.
 It has to be done within Struts.
 
 Bob
 
 Kris Schneider wrote:
 
 Nope, don't think so.

 Quoting Bob Lee [EMAIL PROTECTED]:

  

 Does Struts synchronize on session-scoped forms? For example, can I
 assume that Stuts won't modify the fields on a session-scoped form
in 
 response to one request while an action is still using it?

 Thanks,
 Bob
   


  

 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 


-- 
Thanks
Manish Singla
x73166


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Session-scoped form and synchronization...

2003-10-27 Thread Craig R. McClanahan
Bob Lee wrote:

I assume this is a bug then, because there's no way for me to do this. 
It has to be done within Struts.

It depends on what precisely you think needs to be synchronized:

* Adding attributes to the session, or removing them from the session:
 The servlet container takes care of that for you; nothing we need to do.
* Calling methods on beans in session scope.  In general, any 
synchronization
 here is the responsibility of your application, because there is no 
way for a
 framework to know what's required.  In the particular case of form beans:

 - For standard ActionForm beans, it is your responsibility to synchronize
   for yourself if you need it.  Typically it won't be required for simple
   properties, however, because the ultimate assignment to an instance
   variable inside the bean is idempotent.
 - For DynaActionForm beans, the internal HashMap is *not* synchronized
   (which is what you really want if you use request scope form beans; the
   recommended practice).  If you want to use DynaActionForm beans in
   session scope, and there is the potential for multiple requests 
posting to
   such a form bean at the same time, synchronization *should* be employed.
   I would suggest entering a bug report suggesting we add a property to
   DynaActionForm that enables this if you need it.  In the mean time, 
you can
   also subclass DynaActionForm and add synchronized modifiers on the
   methods that matter (contains, get, remove, and set).

Craig

Bob

Kris Schneider wrote:

Nope, don't think so.

Quoting Bob Lee [EMAIL PROTECTED]:

 

Does Struts synchronize on session-scoped forms? For example, can I 
assume that Stuts won't modify the fields on a session-scoped form 
in response to one request while an action is still using it?

Thanks,
Bob
  


 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Session-scoped form and synchronization...

2003-10-27 Thread Craig R. McClanahan
Peter Abbot wrote:

Generally if you are using a browser based interface to execute a
servlet requests (except if using frames) the user can only send one
request at a time. So if you are using a action with a session form and
another action wants to use that form means that the user doesn't want
the result of the previous request that might still be using the form.
 

Unfortunately, having frames is *not* the only scenario where you have 
to worry about multiple simultaneous requests.  Two simple additional ones:

* Your app contains img tags that point back into your app 
(dynamically generated images,
 for example).

* User starts a long request, presses stop, starts a second request.

Pete

 

Craig


-Original Message-
From: Manish Singla [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 28 October 2003 8:25 a.m.
To: Struts Users Mailing List
Subject: Re: Session-scoped form and synchronization...

hmmm. may be this not an bug...as struts ActionServlet extends  Java

Servlets .
And Java Servlet is not not thread safe
FYI: same goes for application attributes..



Bob Lee wrote:
 

I assume this is a bug then, because there's no way for me to do this.
It has to be done within Struts.
Bob

Kris Schneider wrote:

   

Nope, don't think so.

Quoting Bob Lee [EMAIL PROTECTED]:



 

Does Struts synchronize on session-scoped forms? For example, can I
assume that Stuts won't modify the fields on a session-scoped form
   

in 
 

response to one request while an action is still using it?

Thanks,
Bob
 
   



 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   



 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Session-scoped form and synchronization...

2003-10-27 Thread Geeta Ramani
Craig R. McClanahan wrote:


 Unfortunately, having frames is *not* the only scenario where you have
 to worry about multiple simultaneous requests.  Two simple additional ones:

 * Your app contains img tags that point back into your app
 (dynamically generated images,
   for example).

 * User starts a long request, presses stop, starts a second request.

In fact in order to avoid just this last situation, we disabled all submit
buttons on the page when any one was pressed (and the one that was submitted
changed its face to a Please wait..).  Of course i am sure users can always
find ways to circumvent such blocks, but we at least disabled one of our
testers from being too click-happy..;)



 Pete
 
 
 
 Craig

Geeta


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



OT: Re: Session-scoped form and synchronization...

2003-10-27 Thread Vic Cekvenich


Geeta Ramani wrote:
at we at least disabled one of our
testers from being too click-happy..;)

I hear that.

--
Victor Cekvenich,
Struts Instructor
(215) 321-9146
Advanced Struts Training
http://basebeans.com/do/cmsPg?content=TRAINING Server Side Java
training with Rich UI, mentoring, designs, samples and project recovery
in North East.
Simple best practice basic Portal, a Struts CMS, Membership, Forums,
Shopping and Credit processing, http://basicportal.com software, ready
to develop/customize; requires a db to run.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Session-scoped form and synchronization...

2003-10-27 Thread Andrew Hill
And to add to the list of woes:

Where you have multiple browser windows submitting requests in the same
session - one example being where you want to have the main window show a
table of items from which you may edit or view details of individual items
in new windows.

Session scoped actionforms encounter a problem here, in that for a specific
action/form mapping you have but one key under which the actionform is
stored in the session, making it distinctly 'troublesome' to implement
multiple window detailviews - each window will end up trying to share the
same actionform. (nasty). (Of course the best way round this is to use
request scoped forms, but depending on what you need to do its (usually but)
not always practical).

(We needed to keep our forms session scoped for various reasons but we got
around this another way that involved generating a unique id (appended to
request urls) for an 'operation context' and storing the form in this
'context' in the session. It involves doing fun things with the request
processor and isnt really for the faint hearted...)



-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 28 October 2003 03:57
To: Struts Users Mailing List
Subject: Re: Session-scoped form and synchronization...


Peter Abbot wrote:

Generally if you are using a browser based interface to execute a
servlet requests (except if using frames) the user can only send one
request at a time. So if you are using a action with a session form and
another action wants to use that form means that the user doesn't want
the result of the previous request that might still be using the form.



Unfortunately, having frames is *not* the only scenario where you have
to worry about multiple simultaneous requests.  Two simple additional ones:

* Your app contains img tags that point back into your app
(dynamically generated images,
  for example).

* User starts a long request, presses stop, starts a second request.

Pete



Craig


-Original Message-
From: Manish Singla [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 28 October 2003 8:25 a.m.
To: Struts Users Mailing List
Subject: Re: Session-scoped form and synchronization...


hmmm. may be this not an bug...as struts ActionServlet extends  Java

Servlets .
And Java Servlet is not not thread safe

FYI: same goes for application attributes..



Bob Lee wrote:


I assume this is a bug then, because there's no way for me to do this.
It has to be done within Struts.

Bob

Kris Schneider wrote:



Nope, don't think so.

Quoting Bob Lee [EMAIL PROTECTED]:





Does Struts synchronize on session-scoped forms? For example, can I
assume that Stuts won't modify the fields on a session-scoped form


in


response to one request while an action is still using it?

Thanks,
Bob








-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]










-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]