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 the
> first time I've created a single action, a single service, and single dao
> to persist objects submitted from multiple struts forms. I'm currently
> persisting about 20 domain objects this way, and this is the last issue I
> need to solve to get it all working as desired.
> 
> This issue is a pretty common occurrence in my domain model, so I'd have
> to write code to check for null values in many places for every domain
> object. I've been thinking this problem would be best solved either in the
> struts/view layer, or maybe the persistence layer. I'm spreading myself a
> bit thin trying to work it out at both ends at the same time :-)
> 
> 

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 correct type
(i.e. it implements your interface)

Later,

Andy



-- 
View this message in context: 
http://www.nabble.com/-S2--Iterate-through-two-lists-tp19052842p19086980.html
Sent from the Struts - User mailing list archive at Nabble.com.


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

Reply via email to