You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jacob Weber <ja...@jacobweber.com> on 2004/10/05 17:26:55 UTC
Redirecting and getting the original URL
Hello. In my Struts application, I have an action which forwards to a second
action. The "redirect" parameter is set to false, so the browser's URL doesn't
change.
I'd like to get the original URL that the user requested (the one that's in his
browser). But request.getServletPath() and the various other request methods
return the URL of the second action. One method, getRequestURL(), seems to
return the original URL, but this only works on Tomcat. On WebLogic, it returns
the second one.
Is there a reliable way to get this information? Thanks,
Jacob
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Redirecting and getting the original URL
Posted by Jacob Weber <ja...@jacobweber.com>.
Craig,
Thanks...I'll give that a try.
Jacob
In article <f8...@mail.gmail.com>,
Craig McClanahan <cr...@gmail.com> wrote:
> On a Servlet 2.4 container (such as Tomcat 5.x), the server will store
> the "original" path-related information as a set of request attributes
> with well known names:
>
> javax.servlet.forward.request_uri
> javax.servlet.forward.context_path
> javax.servlet.forward.servlet_path
> javax.servlet.forward.path_info
> javax.servlet.forward.query_string
>
> On a pre-2.4 container, you'll need to save the values yourself prior
> to performing the forward.
>
> Craig
>
>
>
> On Tue, 5 Oct 2004 15:26:55 +0000 (UTC), Jacob Weber
> <ja...@jacobweber.com> wrote:
> > Hello. In my Struts application, I have an action which forwards to a
> > second
> > action. The "redirect" parameter is set to false, so the browser's URL
> > doesn't
> > change.
> >
> > I'd like to get the original URL that the user requested (the one that's in
> > his
> > browser). But request.getServletPath() and the various other request
> > methods
> > return the URL of the second action. One method, getRequestURL(), seems to
> > return the original URL, but this only works on Tomcat. On WebLogic, it
> > returns
> > the second one.
> >
> > Is there a reliable way to get this information? Thanks,
> > Jacob
> >
> > ---------------------------------------------------------------------
> > 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
Re: Redirecting and getting the original URL
Posted by Craig McClanahan <cr...@gmail.com>.
On a Servlet 2.4 container (such as Tomcat 5.x), the server will store
the "original" path-related information as a set of request attributes
with well known names:
javax.servlet.forward.request_uri
javax.servlet.forward.context_path
javax.servlet.forward.servlet_path
javax.servlet.forward.path_info
javax.servlet.forward.query_string
On a pre-2.4 container, you'll need to save the values yourself prior
to performing the forward.
Craig
On Tue, 5 Oct 2004 15:26:55 +0000 (UTC), Jacob Weber
<ja...@jacobweber.com> wrote:
> Hello. In my Struts application, I have an action which forwards to a second
> action. The "redirect" parameter is set to false, so the browser's URL doesn't
> change.
>
> I'd like to get the original URL that the user requested (the one that's in his
> browser). But request.getServletPath() and the various other request methods
> return the URL of the second action. One method, getRequestURL(), seems to
> return the original URL, but this only works on Tomcat. On WebLogic, it returns
> the second one.
>
> Is there a reliable way to get this information? Thanks,
> Jacob
>
> ---------------------------------------------------------------------
> 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