You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by George Moschovitis <gm...@softlab.ntua.gr> on 2002/03/05 10:55:26 UTC
Forwarding to referer
Hi everybody, I am a new user of struts and I have the following question:
at the end of an Action.perform method there is a typical:
return map.findForward("ok");
that forwards to a web page specified in struts-config.
instead of forwarding to a hardcoded url i want to be able to redirect to the referrer for this
action. How can this be done ?
any help appreciated !
George Moschovitis
---
Navel Ltd, Greece
Re: Forwarding to referer
Posted by keithBacon <ke...@yahoo.com>.
Hi George - I just did a post on another subject that's relevant to this.
You still have to have the action name of the referrer in the struts-config but
you can have a list of all possible referrers & specify which one at run time.
I like this as struts-config then documents all possible links between pages.
For mmore sophisticated stuff search the archive on 'workflow' (& work-flow?).
Keith.
--- dderry <dd...@acm.org> wrote:
> Hi George,
>
> What I usually do in this case is to have a hidden field in my form that
> holds the source: <html:hidden property="source" value="somepage.jsp"/>
> Then in the perform method I can:
> return new ActionForward( request.getParameter( "source" ) );
>
> There are of course other ways to handle this (make source an attribute of
> your ActionForm, use Mapping.getInput() with the source specified in
> struts-config.xml), but this works well for me.
>
> Dave D
>
>
> ----- Original Message -----
> From: "George Moschovitis" <gm...@softlab.ntua.gr>
> To: <st...@jakarta.apache.org>
> Sent: Tuesday, March 05, 2002 4:55 AM
> Subject: Forwarding to referer
>
>
> Hi everybody, I am a new user of struts and I have the following question:
>
> at the end of an Action.perform method there is a typical:
>
> return map.findForward("ok");
>
> that forwards to a web page specified in struts-config.
> instead of forwarding to a hardcoded url i want to be able to redirect to
> the referrer for this
> action. How can this be done ?
>
> any help appreciated !
>
> George Moschovitis
>
> ---
> Navel Ltd, Greece
>
>
>
>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
=====
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Search the archive:-
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Keith Bacon - Looking for struts work - South-East UK.
phone UK 07960 011275
__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Forwarding to referer
Posted by dderry <dd...@acm.org>.
Hi George,
What I usually do in this case is to have a hidden field in my form that
holds the source: <html:hidden property="source" value="somepage.jsp"/>
Then in the perform method I can:
return new ActionForward( request.getParameter( "source" ) );
There are of course other ways to handle this (make source an attribute of
your ActionForm, use Mapping.getInput() with the source specified in
struts-config.xml), but this works well for me.
Dave D
----- Original Message -----
From: "George Moschovitis" <gm...@softlab.ntua.gr>
To: <st...@jakarta.apache.org>
Sent: Tuesday, March 05, 2002 4:55 AM
Subject: Forwarding to referer
Hi everybody, I am a new user of struts and I have the following question:
at the end of an Action.perform method there is a typical:
return map.findForward("ok");
that forwards to a web page specified in struts-config.
instead of forwarding to a hardcoded url i want to be able to redirect to
the referrer for this
action. How can this be done ?
any help appreciated !
George Moschovitis
---
Navel Ltd, Greece
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Forwarding to referer
Posted by Eddie Bush <ek...@swbell.net>.
I'm not quite sure what you mean by the 'referer'. Could you elaborate?
Eddie
----- Original Message -----
From: "George Moschovitis" <gm...@softlab.ntua.gr>
To: <st...@jakarta.apache.org>
Sent: Tuesday, March 05, 2002 3:55 AM
Subject: Forwarding to referer
Hi everybody, I am a new user of struts and I have the following question:
at the end of an Action.perform method there is a typical:
return map.findForward("ok");
that forwards to a web page specified in struts-config.
instead of forwarding to a hardcoded url i want to be able to redirect to
the referrer for this
action. How can this be done ?
any help appreciated !
George Moschovitis
---
Navel Ltd, Greece
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Forwarding to referer
Posted by Boney Sze <se...@yahoo.com>.
im not sure if this would work.
but i think you can use your action servlet to display
a dialog which has a input field of some sort and then
use that variable as the forwarding URL and pass it to
struts-config.xml.
Boney Sze
--- George Moschovitis <gm...@softlab.ntua.gr> wrote:
> Hi everybody, I am a new user of struts and I have
> the following question:
>
> at the end of an Action.perform method there is a
> typical:
>
> return map.findForward("ok");
>
> that forwards to a web page specified in
> struts-config.
> instead of forwarding to a hardcoded url i want to
> be able to redirect to the referrer for this
> action. How can this be done ?
>
> any help appreciated !
>
> George Moschovitis
>
> ---
> Navel Ltd, Greece
>
>
>
__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>