You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Affan Qureshi <qu...@etilize.com> on 2002/11/26 10:28:05 UTC

forwarding to Actions expecting ActionForm

I want to forward the request from my Action to another action which expects an ActionForm instance for processing. But my current Action does not have access to that Form. Can I instantiate an ActionForm and store it in the request/session scope on the fly? 

I have a search page which displays results from where I can view details of the results. On the details page if I click "Cancel" I want the user to come back on the Search Results page but with the same results opened. 

Also if the user clicks on Search Tab from anywhere in the app I want the specific (last) search results displayed.

Any ideas? Thanks a lot.

Re: forwarding to Actions expecting ActionForm

Posted by Troy Hart <th...@part.net>.
On Tue, 2002-11-26 at 02:28, Affan Qureshi wrote:
> I want to forward the request from my Action to another action which expects an ActionForm instance for processing. But my current Action does not have access to that Form. Can I instantiate an ActionForm and store it in the request/session scope on the fly? 
> 

When you forward to another action the ActionServlet will look up the
action mapping and automagically instantiate and populate the ActionForm
for you... you don't need to do anything except manage the mapping in
your struts-config.xml.

> I have a search page which displays results from where I can view details of the results. On the details page if I click "Cancel" I want the user to come back on the Search Results page but with the same results opened. 
> 
> Also if the user clicks on Search Tab from anywhere in the app I want the specific (last) search results displayed.
> 

Use the "Bookmark" concept for this prupose. For more information refer
to: http://www.husted.com/about/scaffolding/catalog.htm

> Any ideas? Thanks a lot.

Good Luck


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: forwarding to Actions expecting ActionForm

Posted by Gemes Tibor <ge...@regens.hu>.
2002. november 26. 10:28 dátummal Affan Qureshi ezt írtad:

> I have a search page which displays results from where I can view details
> of the results. On the details page if I click "Cancel" I want the user to
> come back on the Search Results page but with the same results opened.
>
> Also if the user clicks on Search Tab from anywhere in the app I want the
> specific (last) search results displayed.

Store the form in session scope, and don't call reset (except for checkboxes)

Tib

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: forwarding to Actions expecting ActionForm

Posted by Andrew Hill <an...@gridnode.com>.
Yep. You can create the form yourself and store it in the request before
forwarding to the next action (be sure redirecting="false" for the mapping
of course). I forget which key you need to store it under. Check the struts
javadocs.

As for your search results, sounds like these need to be stored in the
session context.

-----Original Message-----
From: Affan Qureshi [mailto:quereshi@etilize.com]
Sent: Tuesday, November 26, 2002 17:28
To: struts-user
Subject: forwarding to Actions expecting ActionForm


I want to forward the request from my Action to another action which expects
an ActionForm instance for processing. But my current Action does not have
access to that Form. Can I instantiate an ActionForm and store it in the
request/session scope on the fly?

I have a search page which displays results from where I can view details of
the results. On the details page if I click "Cancel" I want the user to come
back on the Search Results page but with the same results opened.

Also if the user clicks on Search Tab from anywhere in the app I want the
specific (last) search results displayed.

Any ideas? Thanks a lot.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>