You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Kishan Paandy <ki...@spanservices.com> on 2009/08/13 09:51:01 UTC
Struts - 2.1.6 - Prepare Interceptor
Hi Folks,
I have a problem as below:
1)
public abstract class AbstractBaseAction implements Preparable
{
public void prepare()
{
populateSomething();
}
}
2)
public class MyAction1 extends AbstractBaseAction
{
………
}
3)
public abstract class MyAction2 extends AbstractBaseAction implements
Preparable
{
public void prepare()
{
doSomething();
}
}
4)
public class MyAction3 extends MyAction2
{
………
}
I have a design as above.
The prepare() in AbstractBaseAction will do some common logic for MyAction1,
MyAction2 & MyAction3.
The prepare() in MyAction2 will do some common logic only for MyAction3.
Only the prepare() in MyAction2 is being called for MyAction3. Since it’s
being overridden.
I want both the prepare() in AbstractBaseAction & MyAction2 to be called one
after the other in the same order for MyAction3.
How to achieve this?
Please advice.
Thank you.
Regards,
Kishan.G
--
View this message in context: http://www.nabble.com/Struts---2.1.6---Prepare-Interceptor-tp24950462p24950462.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Struts - 2.1.6 - Prepare Interceptor
Posted by Nils-Helge Garli Hegvik <ni...@gmail.com>.
super.prepare()?
Nils-H
On Thu, Aug 13, 2009 at 9:51 AM, Kishan
Paandy<ki...@spanservices.com> wrote:
>
> Hi Folks,
>
> I have a problem as below:
>
> 1)
> public abstract class AbstractBaseAction implements Preparable
> {
> public void prepare()
> {
> populateSomething();
> }
> }
>
> 2)
> public class MyAction1 extends AbstractBaseAction
> {
> ………
> }
>
> 3)
> public abstract class MyAction2 extends AbstractBaseAction implements
> Preparable
> {
> public void prepare()
> {
> doSomething();
> }
> }
>
> 4)
> public class MyAction3 extends MyAction2
> {
> ………
> }
>
> I have a design as above.
>
> The prepare() in AbstractBaseAction will do some common logic for MyAction1,
> MyAction2 & MyAction3.
> The prepare() in MyAction2 will do some common logic only for MyAction3.
> Only the prepare() in MyAction2 is being called for MyAction3. Since it’s
> being overridden.
> I want both the prepare() in AbstractBaseAction & MyAction2 to be called one
> after the other in the same order for MyAction3.
> How to achieve this?
> Please advice.
> Thank you.
> Regards,
> Kishan.G
> --
> View this message in context: http://www.nabble.com/Struts---2.1.6---Prepare-Interceptor-tp24950462p24950462.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org