Inviting more participants in this
thread please!
I've been investigating formBackingObject() a bit more and didn't realise it gets called when the form is being presented
and when the form is being submitted. Therefore, I think the following logic is what I need and hopefully someone might confirm I'm using this part of Spring as intended:
If formBackingObject() is being called because the form is about to be shown, then the application should create a new object perhaps initialising it with information from a database.
If formBackingObject() is being called because the form is being submitted, then an object should be created but there's no need to initialise it as that data is about to be overwritten from the form.
In fact, if the object contains a list of child items, then it'd be dangerous to initialise it because any that are deleted by the user on the HTML form will not be deleted from the list.
Thanks,
Ed