struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexis Pigeon" <pigeon.ale...@gmail.com>
Subject Re: [S2] (Newbie) Using Preparable
Date Fri, 20 Apr 2007 11:06:34 GMT
Hi Roger,

On 20/04/07, Roger Varley <roger.varley@googlemail.com> wrote:
> Hi
>
> Can someone please explain the point of the Preparable interceptor and
> prepare(). What do I gain over doing everything in the execute()
> method of my action. Obviously there must be some advantage otherwise
> Preparable wouldn't be there, but I can't see it at the moment.

I'm no Struts-guru, but I've been using Struts2 for the last couple of
months, and the main advantage I found in using the Preparable
interface was the ability to execute a certain piece of code whatever
the method you call in the action. However, if the execute() method is
the only one you are calling, prepare() is kind of useless then. I
could have missed other features of the Preparable interface, though.

HTH,
alexis

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message