You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Laurie Harper <la...@holoweb.net> on 2005/11/16 22:10:33 UTC

Re: returning user to the page they where on when they submitted the form?

The answer is, there is no simple answer... assuming I understand what 
you want to do, that is.

I think what you're saying is you have a tile which contains a form and 
which you include on multiple logical pages, and that when the form 
contained in the tile is submitted you want to return to the logical 
page the form was submitted from.

Unfortunately, there's no reliable way to dynamically determine the URL 
of the logical page the form was submitted from. One solution is to 
include the URL you want the user returned to as a request parameter 
when the form is submitted.

Another solution is to have an action mapping for each logical page the 
tile can be part of so you can set up the 'input' attribute (or a nested 
'forward' element) appropriately, but that could get messy if you use 
the tile in a lot of different logical pages.

If you have URLs that are amenable to it, another possibility is to use 
wildcard action paths. That would allow you to have a single action 
mapping the form always sumbits through which uses a wildcard to match 
the URL to return to... For example, if you had an action mapping with 
path="/**/SubmitMySharedForm", you could set the 'input' attribute to 
'{1}' and have the form submit to 
'/url/to/return/to/SubmitMySharedForm.do'.

As I said, it's not as trivial a problem as it seems at first glance. 
Micheal's Struts Dialogs may help (I'll let him comment on that). And 
I'm sure there are lots of other possible approaches I haven't thought 
of off hand!

L.

Mick Knutson wrote:
> My issue is that this action is called from many different pages. How do
> I accomplish that?
> 
> 
> -----Original Message-----
> From: Deepa Khetan [mailto:deepa.khetan@gmail.com] 
> Sent: Tuesday, November 15, 2005 7:38 PM
> To: Struts Users Mailing List
> Subject: Re: returning user to the page they where on when they
> submitted the form?
> 
> in ur action mappings in struts-config.xml , u can specify the
> input="<tile-def-name>" and so whenevr u want the user to return to the
> input page, u can say mapping.getInput() anf forward the user to the
> page
> they were on when they submitted the form
>  HTH
> Deepa
> 
>  On 11/16/05, Mick Knutson <mi...@safeway.com> wrote:
> 
>>I have a tile component that I use many places in my app, and I want
> 
> to
> 
>>return the user back to the page they where on when they submitted the
>>component form.
>>
>>How can I do this?
>>
>>
>>"MMS <safeway.com <http://safeway.com>>" made the following
> 
> annotations.
> 
>>
> ------------------------------------------------------------------------
> ------
> 
>>Warning:
>>All e-mail sent to this address will be received by the Safeway
> 
> corporate
> 
>>e-mail system, and is subject to archival and review by someone other
> 
> than
> 
>>the recipient. This e-mail may contain information proprietary to
> 
> Safeway
> 
>>and is intended only for the use of the intended recipient(s). If the
> 
> reader
> 
>>of this message is not the intended recipient(s), you are notified
> 
> that you
> 
>>have received this message in error and that any review,
> 
> dissemination,
> 
>>distribution or copying of this message is strictly prohibited. If you
> 
> have
> 
>>received this message in error, please notify the sender immediately.
>>
>>
>>
> 
> ========================================================================
> ======
> 
>>
> 
> "MMS <safeway.com>" made the following annotations.
> ------------------------------------------------------------------------------
> Warning: 
> All e-mail sent to this address will be received by the Safeway corporate e-mail system, and is subject to archival and review by someone other than the recipient.  This e-mail may contain information proprietary to Safeway and is intended only for the use of the intended recipient(s).  If the reader of this message is not the intended recipient(s), you are notified that you have received this message in error and that any review, dissemination, distribution or copying of this message is strictly prohibited.  If you have received this message in error, please notify the sender immediately. 
>   
> ==============================================================================


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