DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11021>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11021

ActionForward or <html:link> tag does not support absolute URIs





------- Additional Comments From [EMAIL PROTECTED]  2003-01-24 18:55 -------
Here is an explantion of the previously sent JAR: 
For reference here are the links I have defined, inside a non-ROOT context: 

RELATIVE LINKS, without <HTML:BASE> Tag
<html:link page="news/index.htm"> News </html:link>
<a href="news/index.htm"> Noticias Generales (LINK PURO) </a>

Results: 
In the current nightly build:
* ERROR: The Struts HTML:link tag appends the whole string, it lacks a slash.

RELATIVE LINKS, with <HTML:BASE> Tag
<html:link page="news/index.htm"> News </html:link>
<a href="news/index.htm"> Noticias Generales (LINK PURO) </a>

Results: 
In the current nightly build:
* ERROR: The Struts HTML:link tag appends the whole string, it lacks a slash.


ABSOLUTE LINKS, with <HTML:BASE> Tag
<html:link page="/news/index.htm"> News </html:link>
<a href="/news/index.htm"> Noticias Generales (LINK PURO) </a>

In the current nightly build:
* The Struts HTML:link is OK, it leaves you in the same Context (due to
HTML:BASE), no problem with the lacking slash.

ABSOLUTE LINKS, without <HTML:BASE> Tag
<html:link page="/news/index.htm"> News </html:link>
<a href="/news/index.htm"> Noticias Generales (LINK PURO) </a>
In the current nightly build:
* ERROR: The Struts HTML:link leaves you in the same Context, should drop you
down to the News Context

---- Modified org.apache.struts.util.RequestUtils.java to correct problems ----
---- Here is the DIFF that solves de Problem ----
---- The attachd JAR reflect this change ----


455,456c455
< // DONT Append de Context here, do it while forming the Page URL
< // url.append(request.getContextPath());
---
> url.append(request.getContextPath());
1444,1456c1443,1444
< // smoothly insert a '/' if needed
< if (!page.startsWith("/")) {
< // This means we have a Relative URL 
< // Lets append the Context here 
< sb.append(request.getContextPath());
< // Had to add Slash
< sb.append("/");
< } else {
< // No need for Context.
< // Simply do Nothing.
< // We somehow have to check if the Absolute Path is 
< // referenced inside a page contaning <HTML:BASE> < }
< // Now lets append the Page
< sb.append(page);
---
> sb.append(appConfig.getPrefix());
> sb.append(page);

NOTE: This previous fix, BREAKS the following: 

ABSOLUTE LINKS, with <HTML:BASE> Tag
<html:link page="/news/index.htm"> News </html:link>

If you define this link inside a non-ROOT context, the <HTML:BASE> doesn't take
effect 
as it drops you down to the news context in this case...

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

Reply via email to