You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Hans Gerwitz <ja...@phobia.com> on 2000/09/06 21:30:18 UTC

Forward to referer?

We want to have a form that appears on many pages, and is hence included
from another file, output by a presentation-layer bean, or whathaveyou.

The problem is that the action the form submits to needs to return to the
view page that contained the form.  This is easy enough (action bean looks
up the HTTP_REFERER header and specifies forwarding to the servlet) but is
the only case where we've had to deviate from looking up a forward name (or
inputForm attribute) via ActionMapping.

My thought: can we specify a "special" forward in action.xml that means
"back to the referring view"?  I haven't dug into the source looking for
this behavior, but I don't think it is there.  If not, can we add it to the
TODO list, Craig?  Have to keep that list healthy :-)

-- 
Hans Gerwitz
hans@phobia.com


Re: Forward to referer?

Posted by Hans Gerwitz <ja...@phobia.com>.
I beg to differ.  mapping.getInputForm() will return the inputForm attribute
of the <action> element in action.xml.  I want a straightforward mechanism
for returning to the *true* referer.  This cannot be known for action.xml
configuration because the action will have been invoked by a form that
exists on many different pages.

In other words, I want a "special" value for the <forward> tag that
evaluates to request.getHeader("Referer") at runtime.
-- 
Hans Gerwitz
hans@phobia.com

> From: David Geary <sa...@tri-lakesonline.net>
> Reply-To: struts-user@jakarta.apache.org
> Date: Wed, 06 Sep 2000 15:33:07 -0600
> To: struts-user@jakarta.apache.org
> Cc: Andrew Hoog <an...@qett.com>
> Subject: Re: Forward to referer?
> 
> Returning mapping.getInputForm() from your action's perform method will take
> you
> back to the "referring view".
> 
> 
> david
> 
> Hans Gerwitz wrote:
> 
>> We want to have a form that appears on many pages, and is hence included
>> from another file, output by a presentation-layer bean, or whathaveyou.
>> 
>> The problem is that the action the form submits to needs to return to the
>> view page that contained the form.  This is easy enough (action bean looks
>> up the HTTP_REFERER header and specifies forwarding to the servlet) but is
>> the only case where we've had to deviate from looking up a forward name (or
>> inputForm attribute) via ActionMapping.
>> 
>> My thought: can we specify a "special" forward in action.xml that means
>> "back to the referring view"?  I haven't dug into the source looking for
>> this behavior, but I don't think it is there.  If not, can we add it to the
>> TODO list, Craig?  Have to keep that list healthy :-)
>> 
>> --
>> Hans Gerwitz
>> hans@phobia.com
> 
> 


Re: Forward to referer?

Posted by David Geary <sa...@tri-lakesonline.net>.
Returning mapping.getInputForm() from your action's perform method will take
you
back to the "referring view".


david

Hans Gerwitz wrote:

> We want to have a form that appears on many pages, and is hence included
> from another file, output by a presentation-layer bean, or whathaveyou.
>
> The problem is that the action the form submits to needs to return to the
> view page that contained the form.  This is easy enough (action bean looks
> up the HTTP_REFERER header and specifies forwarding to the servlet) but is
> the only case where we've had to deviate from looking up a forward name (or
> inputForm attribute) via ActionMapping.
>
> My thought: can we specify a "special" forward in action.xml that means
> "back to the referring view"?  I haven't dug into the source looking for
> this behavior, but I don't think it is there.  If not, can we add it to the
> TODO list, Craig?  Have to keep that list healthy :-)
>
> --
> Hans Gerwitz
> hans@phobia.com