struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tal Lev-Ami <...@trivnet.com>
Subject RE: Redirecting to a relative URL from root
Date Thu, 12 Sep 2002 17:40:03 GMT
If you are using Struts 1.1b it will not work. In case of redirect="true",
the RequestProcessor always prepends request.getContextPath() to the URI
received from processing the ForwardConfig. 
If you really want to you can redirect from the Action itself and return
null, or write a generic action that does that and receive the URL in the
property field. IMHO its important enough to be fixed in the framework
itself.

Tal Lev-Ami
Trivnet Ltd.

-----Original Message-----
From: Will Spies [mailto:spiesw@towers.com]
Sent: Thu, September 12, 2002 8:26 PM
To: Struts Users Mailing List
Subject: Re: Redirecting to a relative URL from root





So, are you saying there is no solution?

What about './mydir/mypage.html'?

I am just about to test this but my proxy server is down.

P.S. That's dot (.) slash (/)

_______________________
Will Spies
Towers Perrin
Phone: (215)246-7145
e-mail: spiesw@towers.com


 

 

                                               To:
struts-user@jakarta.apache.org

                      "Donald Ball"            cc:       (bcc: Will
Spies/Towers Perrin)                                               
                      <dball@rhoworld.c        Subject:  Re: Redirecting to
a relative URL from root                                   
                      om>

 

                      09/12/02 12:20 PM

                      Please respond to

                      "Struts Users

                      Mailing List"

 

 





On 9/12/2002 at 12:08 PM Michael Lee wrote:

>Cool! Did not know that! I take it when you say that solution doesn't work
>you just mean the one scentence..

I meant the suggested solution, namely that you use absolute URLs in your
struts-config.xml file when redirecting a user to another webapp on the
same server as your webapp isn't a very good one because it forces you to
hard-code things into your struts-config file that you shouldn't have to.

>" If your going to another webapp just do an http://.... (Is this last
>sentence right?)"
>So you just use // and it get's you to domain root? Is that right?
>so if I had
>http://domain.com/webapp1/somepage.jsp
>http://domain.com/webapp2/somepage.jsp
>
>from somepage.jsp all urls from "/anotherpage.jsp" would be
>http://domain.com/webapp1/anotherpage.jsp
>
>and to go to webapp2/somepage.jsp the url would be
>"//webapp2/sompage.jsp" which equates to
>http://domain.com/webapp2/somepage.jsp
>
>Is this correct?

Unfortunately, no, it does _not_ work this way right now. I'm suggesting
that struts be modified so that this syntax will be supported.

(note if you like the proposal, it's only a few lines of code to modify
performActionForward to make it happen, you needn't wait for the struts
developers to approve it if you're comfortable extending struts on your
own)

- donald


--
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>

--
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