What parameters are you using for the path?
My interpretation of the Struts code is that it adds the context path (and
module) if the "path" starts with "/".  If you don't want struts to do this, try
specifying a path that doesn't start with "/".

I've tried this and it works, but I had to hardcode the full url:

<action path="/strutstest"
  type="com.hkrabago.samples.actions.StrutsTestAction">

 <forward name="redirectToYahoo" path="http://www.yahoo.com"; redirect="true"/>

 <forward name="redirectToOtherApp"
path="http://localhost:8080/otherApp/JspTester.jsp"; redirect="true"/> 

</action>



--- Marcella Turner <[EMAIL PROTECTED]> wrote:
> Hubert,
> 
> Thanks very much for your prompt suggestion :)  I tried your first 
> suggestion, but got a 404 error.  Is this because the contextPath is getting 
> in the way?
> 
> > > You can use redirect="true" to redirect to yahoo:
> > >
> > > <action path="..." ....>
> > > <forward name="redirectToYahoo" path="http://www.yahoo.com"; 
> >redirect="true"/>
> > > </action>
> > >
> > > and in your Action:
> > > return mapping.findForward("redirectToYahoo");
> 
> The contextPath may prove to be a real problem for me since I would like to 
> transfer control to a servlet in a different contextPath than the one my app 
> is in.
> 
> Thanks again,
> Marcella
> 
> >From: Hubert Rabago <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: Struts Users Mailing List <[EMAIL PROTECTED]>
> >Subject: Re: Trouble redirecting
> >Date: Wed, 5 Nov 2003 08:49:41 -0800 (PST)
> >
> >If you want to do the redirect from within your Action, you can still use
> >response.sendRedirect("http://www.yahoo.com";); and then return null to 
> >Struts
> >instead of an ActionForward.
> >
> >--- Hubert Rabago <[EMAIL PROTECTED]> wrote:
> > > What does your action mapping look like and what are your returning to 
> >struts
> > > from within your Action?
> > > You can use redirect="true" to redirect to yahoo:
> > >
> > > <action path="..." ....>
> > > <forward name="redirectToYahoo" path="http://www.yahoo.com"; 
> >redirect="true"/>
> > > </action>
> > >
> > > and in your Action:
> > > return mapping.findForward("redirectToYahoo");
> > >
> > >
> > > --- Marcella Turner <[EMAIL PROTECTED]> wrote:
> > > > I'm trying to use a response.sendRedirect("http://www.yahoo.com";); in 
> >my
> > > > action servlet (yahoo is not my actual goal but i needed to see if
> > > > sendRedirect() would work for me at all).
> > > >
> > > > However, I'm getting a NullPointerException from the
> > > > org.apache.struts.util.RequestUtils.forwardURL().  I don't understand 
> >this
> > > > since I'm passing a literal string which represents a URL.
> > > >
> > > > Any pointers would be appreciated.
> > > >
> > > > Marcella
> > > >
> > > > _________________________________________________________________
> > > > MSN Messenger with backgrounds, emoticons and more.
> > > > http://www.msnmessenger-download.com/tracking/cdp_customize
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > >
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > Protect your identity with Yahoo! Mail AddressGuard
> > > http://antispam.yahoo.com/whatsnewfree
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> >
> >__________________________________
> >Do you Yahoo!?
> >Protect your identity with Yahoo! Mail AddressGuard
> >http://antispam.yahoo.com/whatsnewfree
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> 
> _________________________________________________________________
> From Beethoven to the Rolling Stones, your favorite music is always playing 
> on MSN Radio Plus. No ads, no talk. Trial month FREE!  
> http://join.msn.com/?page=offers/premiumradio
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to