Re: Find out the old url after struts forwarding

2006-08-02 Thread Monkeyden

I suppose you could get the http referer but it would have nothing to do
with what you see in the browser address bar.

req.getHeader(Referer);



On 8/2/06, Wbyeats [EMAIL PROTECTED] wrote:



Hi guys,

I have this problem: I'm using websphere 4, wth JDK 1.3 and J2EE 1.2, and
struts.
I have set an action that after doing some coding would forward
(redirect=false) to a jsp. In the browser url I correctly see the .do url.

If in that page I ask for a request.getRequestURI() I get the url of the
new
jsp. How should I find out the old .do url as the request is still the
same?
Is there any way?

Thanks a lot in advance!!

mario

--
View this message in context:
http://www.nabble.com/Find-out-the-old-url-after-struts-forwarding-tf2042007.html#a5621340
Sent from the Struts - User forum at Nabble.com.


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




Re: Find out the old url after struts forwarding

2006-08-02 Thread Wbyeats

 I suppose you could get the http referer but it would have nothing to do 
 with what you see in the browser address bar. 
 req.getHeader(Referer);

Nope, that's not what I want. I need this as I want to make a link to reload
page changing the language. So I want the url of the page I'm seeing. This
could be a .jsp and that is not a problem, but in case of a .do I would like
to have the .do url not the resultant .jsp url.
As I'm keeping the request I don't see why I can't have the original url...

mario
-- 
View this message in context: 
http://www.nabble.com/Find-out-the-old-url-after-struts-forwarding-tf2042007.html#a5622597
Sent from the Struts - User forum at Nabble.com.


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



Re: Find out the old url after struts forwarding

2006-08-02 Thread Monkeyden

mapping.getPath()

On 8/2/06, Wbyeats [EMAIL PROTECTED] wrote:



 I suppose you could get the http referer but it would have nothing to do
 with what you see in the browser address bar.
 req.getHeader(Referer);

Nope, that's not what I want. I need this as I want to make a link to
reload
page changing the language. So I want the url of the page I'm seeing. This
could be a .jsp and that is not a problem, but in case of a .do I would
like
to have the .do url not the resultant .jsp url.
As I'm keeping the request I don't see why I can't have the original
url...

mario
--
View this message in context:
http://www.nabble.com/Find-out-the-old-url-after-struts-forwarding-tf2042007.html#a5622597
Sent from the Struts - User forum at Nabble.com.


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




Re: Find out the old url after struts forwarding

2006-08-02 Thread Wbyeats

But how would I use a mapping.getPath() inside a jsp?

mario
-- 
View this message in context: 
http://www.nabble.com/Find-out-the-old-url-after-struts-forwarding-tf2042007.html#a5623015
Sent from the Struts - User forum at Nabble.com.


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



Re: Find out the old url after struts forwarding

2006-08-02 Thread Michael Jouravlev

On 8/2/06, Wbyeats [EMAIL PROTECTED] wrote:


Hi guys,

I have this problem: I'm using websphere 4, wth JDK 1.3 and J2EE 1.2, and
struts.
I have set an action that after doing some coding would forward
(redirect=false) to a jsp. In the browser url I correctly see the .do url.

If in that page I ask for a request.getRequestURI() I get the url of the new
jsp. How should I find out the old .do url as the request is still the same?


request.getRequestURL() work for me, returning full URL including
http and port number. If you need URI only, use
request.getAttribute(javax.servlet.forward.request_uri)

http://www.javaworld.com/javaworld/jw-03-2003/jw-0328-servlet_p.html

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



Re: Find out the old url after struts forwarding

2006-08-02 Thread Monkeyden

Pass it to the JSP from the action in the request object?  action form?
session?  Pick your poison.

request.setAttribute(URL, mapping.getPath() + ?language=swahili);




On 8/2/06, Wbyeats [EMAIL PROTECTED] wrote:



But how would I use a mapping.getPath() inside a jsp?

mario
--
View this message in context:
http://www.nabble.com/Find-out-the-old-url-after-struts-forwarding-tf2042007.html#a5623015
Sent from the Struts - User forum at Nabble.com.


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




Re: Find out the old url after struts forwarding

2006-08-02 Thread Frank W. Zammetti
It's already there, as a request attribute, under the key 
org.apache.struts.action.mapping.instance, or more precisely, under 
the key named by the value of Globals.MAPPING_KEY.


Frank

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM/Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Author of Practical Ajax Projects With Java Technology
 (2006, Apress, ISBN 1-59059-695-1)
Java Web Parts - http://javawebparts.sourceforge.net
 Supplying the wheel, so you don't have to reinvent it!

Monkeyden wrote:

Pass it to the JSP from the action in the request object?  action form?
session?  Pick your poison.

request.setAttribute(URL, mapping.getPath() + ?language=swahili);




On 8/2/06, Wbyeats [EMAIL PROTECTED] wrote:



But how would I use a mapping.getPath() inside a jsp?

mario
--
View this message in context:
http://www.nabble.com/Find-out-the-old-url-after-struts-forwarding-tf2042007.html#a5623015 


Sent from the Struts - User forum at Nabble.com.


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







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