Adam Hardy <[EMAIL PROTECTED]> wrote: > Dave Newton on 31/01/08 15:29, wrote: >> Adam Hardy <[EMAIL PROTECTED]> wrote: >>> * ModelDriven: how do I get hold of my model during my action methods? I >>> don't want to get getModel() again, because that will retrieve another >>> instance of the entity and not the one that was populated by struts. >> >> Lazy initialization (via null check or by setting an instance var), or >> config through Spring, or... > > If your getModel() puts the model entity on an instance variable, won't > that confuse the param interceptor?
Depends on what instance variable you put it in, I suppose. One of your questions was how to access the model object w/o running through a getModel() method that would re-instantiate; lazily initializing an instance variable in getModel() then using that instance variable is one way of dealing with that. > Then it'll have the choice of populating the model it got from > getModel() and it'll see that there's a model entity on the action > too. Again, this is a different issue than I answered. But nobody says the instance variable needs to be a publicly-accessible JavaBean property. Dave --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]