Strange,

In the logs I can see a new Action instance being created for every
request. However, for a given form object getting set on the Action, I'm
seeing the same object instance is being set for every request. The only
way I can get the expected behaviour is if I shut down tomcat between
each request.

I have no idea how I have got this to happen.

As the object is persisted with hibernate, could keeping a reference to
the object in hibernate mean that struts would also keep a reference to
the object instance? Thus not creating a new object for each request? 

It's a bit of a long shot, but I'm stumped. I've not written any custom
interceptors or anything, it's all pretty bog standard actions and
struts forms.



-----Original Message-----
From: Dave Newton [mailto:[EMAIL PROTECTED] 
Sent: 09 October 2008 17:20
To: Struts Users Mailing List
Subject: RE: Struts 2 CRUD Question

--- On Thu, 10/9/08, Gawain Hammond wrote:
> Does struts create a new object for every submit? And under
> what circumstance would it not?

Actions are created per-request, thus action variables are as well.
Options include retrieving a session object manually, using
ScopedModelDriven, a conversation interceptor, and so on.

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
----------------------------------------------------------
This transmission is strictly confidential, possibly legally privileged, and 
intended solely for the 
addressee.  Any views or opinions expressed within it are those of the author 
and do not necessarily 
represent those of 192.com, i-CD Publishing (UK) Ltd or any of it's subsidiary 
companies.  If you 
are not the intended recipient then you must not disclose, copy or take any 
action in reliance of this 
transmission. If you have received this transmission in error, please notify 
the sender as soon as 
possible.  No employee or agent is authorised to conclude any binding agreement 
on behalf of 
i-CD Publishing (UK) Ltd with another party by email without express written 
confirmation by an 
authorised employee of the Company. http://www.192.com (Tel: 08000 192 192).  
i-CD Publishing (UK) Ltd 
is incorporated in England and Wales, company number 3148549, VAT No. GB 
673128728.

Reply via email to