struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Hickey" <bhic...@r-effects.com>
Subject Re: How to Redirect ???
Date Mon, 18 Nov 2002 17:38:08 GMT
Wolfgang,

Redirect outside of an app can be done a number of ways.

One suggestion:

Map your redirect to a class that creates the forwardURL.
Put the forwardURL into request scope.
Create a JSP that does nothing but the redirect. Map to it in struts-config.
use the jsp:usebean and <meta http_equiv> tag to perform the external
redirect.

The advantage of this method is logging which can be done in the class and
you have no context other than what you specify in the <meta http-equiv>
tag.


Brian



----- Original Message -----
From: "Kris Schneider" <kris@dotech.com>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Monday, November 18, 2002 11:58 AM
Subject: Re: How to Redirect ???


> That's not what the contextRelative attribute means. Here's the snippet
from
> the 1.1 DTD:
>
> contextRelative  Set this to "true" if, in a modular application, the path
>                  attribute starts with a slash "/" and should be
considered
>                  relative to the entire web application rather than the
module.
>                  Since Struts 1.1.
>                  [false]
>
> The redirect attribute only determines if RequestDispatcher.forward or
> HttpServletResponse.sendRedirect is used. In either case, the path
attribute is
> always either module-relative or context-relative.
>
> I think you'll have to use something like HttpServletResponse.sendRedirect
> directly in your Action to redirect outside your app's context.
>
> Quoting "Trieu, Danny" <DTrieu@downeysavings.com>:
>
> > Isn't there is a contextrelative attribute in the <forward/> tag where
you
> > can set to 'true'?
> >
> > -----Original Message-----
> > From: wolfgang [mailto:wolfgang127jp@ybb.ne.jp]
> > Sent: Monday, November 18, 2002 8:15 AM
> > To: struts-user@jakarta.apache.org
> > Subject: How to Redirect ???
> >
> >
> > Hi there,
> >
> > I wanna make users redirect(not forward) to http://www.yahoo.com , but
> > cannot make it...
> >
> > I added the following elements in the struts-config.xml
> >
> > <global-forwards>
> >   <forward name="finish" path="http://www.yahoo.com" redirect="true" />
> > </global-forwards>
> >
> > and the following code in the execute method of the Action class.
> >
> > return mapping.findForward("finish");
> >
> > but It doesn't work.
> > Struts attempts to make users redirect to the
> > "/test_webapp/http://www.yahoo.com" where /test_webapp is the name of my
> > web
> > application.
> >
> > How can I make it ??
> >
> > Thanks in advance.
> >
> > wolfgang-
> >
> >
> > --
> > wolfgang <wolfgang127jp@ybb.ne.jp>
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:struts-user-help@jakarta.apache.org>
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:struts-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:struts-user-help@jakarta.apache.org>
> >
>
>
> --
> Kris Schneider <mailto:kris@dotech.com>
> D.O.Tech       <http://www.dotech.com/>
>
> --
> To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
>
>


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


Mime
View raw message