I think you cann't expect Struts 2 to automatically remove an object just
because one of it's properties is set to null. Ok, in your case it's the
id-property but struts 2 (or better OGNL) doesn't know that.
So i don't think this is worth a feature request.
But here is the workaround i'd use:
if *all* of it's properties were null, not
just one. Would your answer be the same given this minor difference?
-Original Message-
From: Stephan Schröder [mailto:[EMAIL PROTECTED]
Sent: 21 August 2008 09:10
To: Struts Users Mailing List
Subject: Re: [S2] Does struts set null values
://www.opensymphony.com/ognl/html/DeveloperGuide/index.html
/Stephan
Original-Nachricht
Datum: Thu, 21 Aug 2008 11:36:47 +0100
Von: Gawain Hammond [EMAIL PROTECTED]
An: Struts Users Mailing List user@struts.apache.org
Betreff: RE: [S2] Does struts set null values for pojo fields
Gawain Hammond wrote:
Thanks very much for your reply.
The problem with this type of work around is that it completely messes up
my fiendish master plan. If it wasn't for those pesky objects with null
values! :-P
You see, I've probably been a bit too clever for my own good, and for
Can you define an interface that is common across all the actions/model
objects. Then you can have the relevant Actions implement the interface
and
write an interceptor to check the value of the specified fields and set
them
to null if required after checking that the object is of the
What you are saying when you post user.group.id = '' is to set the
group object of the user id property to null. What you want to say is
set user.group to null.
To do that create a TypeConverter for Group rather than try to
maintain the id directly. This way when the id (String
6 matches
Mail list logo