Hi, my application need to post a form with one bean, to bind the parameters in the request to this bean, and then to retrieve another instance of this bean to pass it back to the view.
The issue I have been having here, is that from my understanding, in a SimpleFormController, the bean retrieved by the formBackingObject method, will be the same one than the one spring will use to bind the parameters and pass back to the form in the showForm method after a submit.
I solved my issue, by overriding the referenceData since this method is executed after the bind process and before the showForm. I add the following code line :
It worked but look for me like a hack more than a standard use of the SimpleFormController. What do the spring team will recommand ?Code:MyNewBean bean= manager.getBean(myNewID); BindException bind = new BindException(bean,getCommandName()); model.put(getCommandName(),bean); model.put(BindException.class.getName()+"."+getCommandName(),bind);
Thanks
Olivier


Reply With Quote