t case provided there you need to check it out and start using it
when writing these kinds of actions.
I hope some of this makes sense.
Thanks,
Andrew
-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 31, 2008 5:03 PM
To: Struts Users Mailing List
S
I thought I'd quickly describe my usages and opinions of Preparable and
ModelDriven in case it helps any one:
- As Dave described, I also prefer to keep my prepare logic with the
main code because it's easier for others to understand.
- I do use Preparable in the cases where params-prepare-para
Struts will by default populate parameters in your action, if you use
ModelDriven, then you can supply the object that will be populated
instead of the action. Implementing preparable will make struts call
prepare() before the action is executed, or prepareX() before X() is
executed. They are just
I don't think you are strictly conveying the intended usage, when you say that
the getModel() method will 'later' return the model. It depends how your
interceptor stack is ordered. In the docs, it explicitly says the
ModelDrivenInterceptor should come before ParametersInterceptor, as often the
Dave Newton wrote:
--- Roberto Nunnari <[EMAIL PROTECTED]> wrote:
The prepare() method task is to retrive the model
and store it as an instance variable.
The getModel() method will later return the model
when asked by the framework that will put it on the
value stack.
Please correct me if I'm
--- Roberto Nunnari <[EMAIL PROTECTED]> wrote:
> The prepare() method task is to retrive the model
> and store it as an instance variable.
>
> The getModel() method will later return the model
> when asked by the framework that will put it on the
> value stack.
>
> Please correct me if I'm wrong.
you are right.
On Jan 31, 2008 1:12 PM, Roberto Nunnari <[EMAIL PROTECTED]> wrote:
> The prepare() method task is to retrive the model
> and store it as an instance variable.
>
> The getModel() method will later return the model
> when asked by the framework that will put it on the
> value stack.
The prepare() method task is to retrive the model
and store it as an instance variable.
The getModel() method will later return the model
when asked by the framework that will put it on the
value stack.
Please correct me if I'm wrong.
Best regards.
--
Robi
Adam Hardy wrote:
Dave Newton on
Dave Newton on 31/01/08 16:00, wrote:
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 anoth
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
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.
--- Adam Hardy <[EMAIL PROTECTED]> wrote:
> Is my understanding correct that Preparable and ModelDriven are 2 different
> ways of doing the same thing, or are they complementary in any way?
They *could* be used to do the same thing, but IMO Preparable is more
general-purpose than ModelDriven, and
12 matches
Mail list logo