You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Jiang, Jane (NIH/NCI) [C]" <ji...@mail.nih.gov> on 2007/11/09 18:46:12 UTC

S2: dynamic forwarding from Action class to external url

I am also trying to forward my Action to an external report URL after
process the form. I tried to use redirect and it always prefix my URL
with my application context.  

I also tried to implement ServletResponseAware and use
response.sendRedirect().  It does not seem to do anything.  The default
result "success" is used when I return null from my Action.

Is there a way to redirect action to an external URL? 

-----Original Message-----
From: Chris Pratt [mailto:thechrispratt@gmail.com] 
Sent: Friday, September 07, 2007 12:44 PM
To: Struts Users Mailing List
Subject: Re: dynamic forwarding from Action class to any url

> > Is it possible to dynamicaly forward to any page from Action class
> > execute()

Make your Action implement ServletResponseAware, then just use the
response.sendRedirect() method to redirect to where you want to go.
Then return null from your action to let Struts 2 know that you've
handled things yourself.
  (*Chris*)

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

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