When prepare/getModel misbehave! I guess I'm wondering if the framework should have a safety net to fall back on when an object is *not* produced by user code.
On 9/23/07, Laurie Harper <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] wrote: > > If your action class implements ModelDriven and Preparable and your > prepare > > method returns a null object, ParameterInterceptor tries to set the > parms > > which are names appropriate to properties in model object that is > expected > > to be on the top of stack. However, since model was null, it was NOT > SET on > > top of the stack and all the parameters are now looked for in the action > > class. They are not found there (naturally) so all the parm setters > fail. > > Should the ModelDriven interceptor create a model when it is null? > > This is as documented [1]: > > "Note: The ModelDrivenInterceptor will only push the model into the > stack when the model is not null, else it will be ignored." > > When implementing ModelDriven, it is your action's responsibility to > create the model. Whether you choose to accomplish that in a prepare() > method, or by other means, is up to you. > > L. > > [1] http://struts.apache.org/2.x/docs/model-driven-interceptor.html > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Scott [EMAIL PROTECTED]