You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Angie Lin <al...@tivo.com> on 2002/10/07 20:47:13 UTC

RedirectingActionForward?

Hi there,

RedirectingActionForward doesn't seem to redirect anymore.  It's trying 
to forward and I'm ending up with a garbled URL like:

    http://localhost:7001/myapp/http://someothersite.com/

My code is:
    ActionForward oldfwd=mapping.findForward("othersite");
    String path=oldfwd.getPath();
    path.append("?id="+id);
    RedirectingActionForward newfwd=new RedirectingActionForward(path);
    return newfwd;


This used to work in 1.0.2, but I've since upgraded to 1.1b.   I'm also 
using WL6.1 if that helps at all.  

I've searched the archive and read the thread on message 38728, but that 
problem was fixed by setting the contextRelative attribute to true, 
which doesn't quite help me, since I'm trying to forward to another 
domain.  

Any other configuration settings I might be missing?


-- 
Angie Lin



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


Re: RedirectingActionForward?

Posted by Billy Ng <kw...@earthlink.net>.
I posted a question earlier regarding the redirect.  I notice I can't do the
sendRedirect after the mapping.findForward is called.  Oterwise, it works
very good with return null.

Billy Ng

----- Original Message -----
From: "Eddie Bush" <ek...@swbell.net>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Monday, October 07, 2002 8:59 PM
Subject: Re: RedirectingActionForward?


> I need to dig into the source more deeply.  I looked briefly but
> couldn't satisfy myself as to whether you could do a redirect that
> wasn't (at least) relative to the application.  Sorry, but this isn't an
> issue I've had to face.  As a last resort you could do:
>
>     response.sendRedirect(response.encodeUrl(path));
>     return null;
>
> Returning null is very important, as it signals the RequestProcessor
> that it doesn't need to do anything else.
>
> Hopefully someone else will have additional wisdom for you.
>
> Angie Lin wrote:
>
> > Trying again....
> >
> > Anybody with clues on why RedirectingActionForward isn't redirecting?
> > This used to work in 1.0.2.
> >
> > Angie Lin wrote:
> >
> >> Hi there,
> >>
> >> RedirectingActionForward doesn't seem to redirect anymore.  It's
> >> trying to forward and I'm ending up with a garbled URL like:
> >>
> >>    http://localhost:7001/myapp/http://someothersite.com/
> >>
> >> My code is:
> >>    ActionForward oldfwd=mapping.findForward("othersite");
> >>    String path=oldfwd.getPath();
> >>    path.append("?id="+id);
> >>    RedirectingActionForward newfwd=new RedirectingActionForward(path);
> >>    return newfwd;
> >>
> >>
> >> This used to work in 1.0.2, but I've since upgraded to 1.1b.   I'm
> >> also using WL6.1 if that helps at all. I've searched the archive and
> >> read the thread on message 38728, but that problem was fixed by
> >> setting the contextRelative attribute to true, which doesn't quite
> >> help me, since I'm trying to forward to another domain. Any other
> >> configuration settings I might be missing?
> >
>
> --
> Eddie Bush
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


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


Re: RedirectingActionForward?

Posted by Eddie Bush <ek...@swbell.net>.
I need to dig into the source more deeply.  I looked briefly but 
couldn't satisfy myself as to whether you could do a redirect that 
wasn't (at least) relative to the application.  Sorry, but this isn't an 
issue I've had to face.  As a last resort you could do:

    response.sendRedirect(response.encodeUrl(path));
    return null;

Returning null is very important, as it signals the RequestProcessor 
that it doesn't need to do anything else.

Hopefully someone else will have additional wisdom for you.

Angie Lin wrote:

> Trying again....
>
> Anybody with clues on why RedirectingActionForward isn't redirecting? 
> This used to work in 1.0.2. 
>
> Angie Lin wrote:
>
>> Hi there,
>>
>> RedirectingActionForward doesn't seem to redirect anymore.  It's 
>> trying to forward and I'm ending up with a garbled URL like:
>>
>>    http://localhost:7001/myapp/http://someothersite.com/
>>
>> My code is:
>>    ActionForward oldfwd=mapping.findForward("othersite");
>>    String path=oldfwd.getPath();
>>    path.append("?id="+id);
>>    RedirectingActionForward newfwd=new RedirectingActionForward(path);
>>    return newfwd;
>>
>>
>> This used to work in 1.0.2, but I've since upgraded to 1.1b.   I'm 
>> also using WL6.1 if that helps at all. I've searched the archive and 
>> read the thread on message 38728, but that problem was fixed by 
>> setting the contextRelative attribute to true, which doesn't quite 
>> help me, since I'm trying to forward to another domain. Any other 
>> configuration settings I might be missing? 
>

-- 
Eddie Bush




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


Re: RedirectingActionForward?

Posted by Angie Lin <al...@tivo.com>.
Trying again....

Anybody with clues on why RedirectingActionForward isn't redirecting? 
 This used to work in 1.0.2.  



Angie Lin wrote:

> Hi there,
>
> RedirectingActionForward doesn't seem to redirect anymore.  It's 
> trying to forward and I'm ending up with a garbled URL like:
>
>    http://localhost:7001/myapp/http://someothersite.com/
>
> My code is:
>    ActionForward oldfwd=mapping.findForward("othersite");
>    String path=oldfwd.getPath();
>    path.append("?id="+id);
>    RedirectingActionForward newfwd=new RedirectingActionForward(path);
>    return newfwd;
>
>
> This used to work in 1.0.2, but I've since upgraded to 1.1b.   I'm 
> also using WL6.1 if that helps at all. 
> I've searched the archive and read the thread on message 38728, but 
> that problem was fixed by setting the contextRelative attribute to 
> true, which doesn't quite help me, since I'm trying to forward to 
> another domain. 
> Any other configuration settings I might be missing?
>
>

-- 
Angie Lin
alin@tivo.com
408.519.9250



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