You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Kushan Jayathilake <ku...@gmail.com> on 2010/06/24 08:09:26 UTC

How to call to another action from the action class

Hi Guys,

I want to call to another action mapping which has defined in the struts.xml
file within another action class, its like this,

*struts.xml*

    <action name="readThis" class="com.test.TestAction" method="testMethod">
            <result name="success">/pages/ext/summary.jsp</result>
    </action>


currently im inside of another Action class, from that action class i need
to call to the above mentioned action mapping...

is there anyway to do this.?

-- 
Regards
Kushan Jayathilake

Re: How to call to another action from the action class

Posted by ch...@chrismiles.org.
Hi,

Use a type=redirectAction and then set the result to the action name
(without .action)

Chris

> Hi Guys,
>
> I want to call to another action mapping which has defined in the
> struts.xml
> file within another action class, its like this,
>
> *struts.xml*
>
>     <action name="readThis" class="com.test.TestAction"
> method="testMethod">
>             <result name="success">/pages/ext/summary.jsp</result>
>     </action>
>
>
> currently im inside of another Action class, from that action class i need
> to call to the above mentioned action mapping...
>
> is there anyway to do this.?
>
> --
> Regards
> Kushan Jayathilake
>


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


RE: How to call to another action from the action class

Posted by Martin Gainty <mg...@hotmail.com>.
each action is embedded in its own execution chain e.g.


pre-action1 interceptor,action1,post-action1-interceptor
pre-action2 interceptor,action2,post-action2-interceptor


perhaps what you want is an *post-action1* interceptor


http://struts.apache.org/2.x/docs/building-your-own-interceptor.html

 

?
Martin Gainty 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.

Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.



 

> Date: Thu, 24 Jun 2010 14:37:23 +0530
> Subject: Re: How to call to another action from the action class
> From: jyorajesh@gmail.com
> To: user@struts.apache.org
> 
> You can try by giving the path of the action in place
> of /pages/ext/summary.jsp. Atleast that was how it is done in struts1.3
> 
> Thanks,
> Jyothi
> 
> On Thu, Jun 24, 2010 at 11:39 AM, Kushan Jayathilake <ku...@gmail.com>wrote:
> 
> > Hi Guys,
> >
> > I want to call to another action mapping which has defined in the
> > struts.xml
> > file within another action class, its like this,
> >
> > *struts.xml*
> >
> > <action name="readThis" class="com.test.TestAction" method="testMethod">
> > <result name="success">/pages/ext/summary.jsp</result>
> > </action>
> >
> >
> > currently im inside of another Action class, from that action class i need
> > to call to the above mentioned action mapping...
> >
> > is there anyway to do this.?
> >
> > --
> > Regards
> > Kushan Jayathilake
> >
 		 	   		  
_________________________________________________________________
The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail.
http://www.windowslive.com/campaign/thenewbusy?tile=multiaccount&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4

Re: How to call to another action from the action class

Posted by Jyothi Rajesh <jy...@gmail.com>.
You can try by giving the path of the action in place
of  /pages/ext/summary.jsp. Atleast that was how it is done in struts1.3

Thanks,
Jyothi

On Thu, Jun 24, 2010 at 11:39 AM, Kushan Jayathilake <ku...@gmail.com>wrote:

> Hi Guys,
>
> I want to call to another action mapping which has defined in the
> struts.xml
> file within another action class, its like this,
>
> *struts.xml*
>
>    <action name="readThis" class="com.test.TestAction" method="testMethod">
>            <result name="success">/pages/ext/summary.jsp</result>
>    </action>
>
>
> currently im inside of another Action class, from that action class i need
> to call to the above mentioned action mapping...
>
> is there anyway to do this.?
>
> --
> Regards
> Kushan Jayathilake
>