You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ravi_eze <ra...@ivycomptech.com> on 2008/03/14 06:23:17 UTC

Multiple Actions for a single page. Is this possible

hi,

We have two pages a.jsp and b.jsp developed with the action class mehods
Ac.a() & Ac.b() that render these pages. Now we need to develop a new page
c.jsp which is combination of both a & b.jsps.

i can include the jsps into the c.jsp. But what abt the action class behind?
can they not get automatically invoked and the pages get populated? More
over i have some logic to be performed based on the inputs made in the two
sections of c.jsp. Is it possible for me to only do this part as a layer? 

any ideas as how to go abt this? pl help.

regards,
ravi 


-- 
View this message in context: http://www.nabble.com/Multiple-Actions-for-a-single-page.-Is-this-possible-tp16044652p16044652.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: Multiple Actions for a single page. Is this possible

Posted by "matt.payne" <ma...@gmail.com>.
By chaining several actions together.  All of the getters inside those
actions are availible to the resulting .jsp/vm/or ftl.

I have used chain in cases where I had a more generic action that supplied
values for picklists and I needed those values supplied to several pages. 
The action definitions were configured to include that more generic action
for the picklists.  That is just one use case though.  The above could be
solved via inheritance as well, that has its own side effects.

In the end are you trying to do a more wizard multi/step solution?

Matt

ravi_eze wrote:
> 
> hi,
> 
> We have a form in c.jsp which by some event makes an ajax call fetching
> b.jsp, a.jsp and rendering it. Now the requirement is that 
> 
> (1) i want to get this b.jsp by calling some other action class. 
> (2) Once its rendered and i submit the page c.jsp the consecutive action
> class should be able to get all the entries made even in the b.jsp & a.jsp
> (obtained by ajax call)
> 
> i am not sure how action chanining/ s:action can help me. 
> 
> any hlep / pointers?
> 
> regards,
> ravi 
> 

-- 
View this message in context: http://www.nabble.com/Multiple-Actions-for-a-single-page.-Is-this-possible-tp16044652p16128576.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: Multiple Actions for a single page. Is this possible

Posted by ravi_eze <ra...@ivycomptech.com>.
hi,

We have a form in c.jsp which by some event makes an ajax call fetching
b.jsp, a.jsp and rendering it. Now the requirement is that 

(1) i want to get this b.jsp by calling some other action class. 
(2) Once its rendered and i submit the page c.jsp the consecutive action
class should be able to get all the entries made even in the b.jsp & a.jsp
(obtained by ajax call)

i am not sure how action chanining/ s:action can help me. 

any hlep / pointers?

regards,
ravi 
-- 
View this message in context: http://www.nabble.com/Multiple-Actions-for-a-single-page.-Is-this-possible-tp16044652p16078474.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: Multiple Actions for a single page. Is this possible

Posted by "matt.payne" <ma...@gmail.com>.
chaining is one way to accomplish this.
http://struts.apache.org/2.x/docs/action-chaining.html



ravi_eze wrote:
> 
> hi,
> 
> We have two pages a.jsp and b.jsp developed with the action class mehods
> Ac.a() & Ac.b() that render these pages. Now we need to develop a new page
> c.jsp which is combination of both a & b.jsps.
> 
> i can include the jsps into the c.jsp. But what abt the action class
> behind? can they not get automatically invoked and the pages get
> populated? More over i have some logic to be performed based on the inputs
> made in the two sections of c.jsp. Is it possible for me to only do this
> part as a layer? 
> 
> any ideas as how to go abt this? pl help.
> 
> regards,
> ravi 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Multiple-Actions-for-a-single-page.-Is-this-possible-tp16044652p16050493.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: Multiple Actions for a single page. Is this possible

Posted by Ralf Fischer <th...@googlemail.com>.
Hi,

On 3/14/08, ravi_eze <ra...@ivycomptech.com> wrote:
>  We have two pages a.jsp and b.jsp developed with the action class mehods
>  Ac.a() & Ac.b() that render these pages. Now we need to develop a new page
>  c.jsp which is combination of both a & b.jsps.
>
>  i can include the jsps into the c.jsp. But what abt the action class behind?
>  can they not get automatically invoked and the pages get populated? More
>  over i have some logic to be performed based on the inputs made in the two
>  sections of c.jsp. Is it possible for me to only do this part as a layer?
>
>  any ideas as how to go abt this? pl help.

Check out the <s:action /> tag, when c.jsp is rendered you can place
actions on it. All the stuff including interceptors will be invoked
for each action by creating a new action proxy. Don't forget to set
executeResult="true" so the output gets' rendered.

The surrounding action (if c.jsp is an action result) will still be on
the stack.

Cheers,
-Ralf

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