For Implementation for preparable interface Musachy has a full example
located at
http://struts.apache.org/2.x/docs/struts-2-spring-2-jpa-ajax.html
The prepare() method may be used in your class such to obtain ID as the
prepare method will execute before the execute() method
prepare method will execute before modification by the interceptors
http://forums.opensymphony.com/thread.jspa;jsessionid=aJxkusYMVFMhXopepi?messageID=4347჻
M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed. If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy. Thank you.
----- Original Message -----
From: "Alexis Pigeon" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Friday, April 20, 2007 7:06 AM
Subject: Re: [S2] (Newbie) Using Preparable
Hi Roger,
On 20/04/07, Roger Varley <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]