The ampersand is only encoded in xhtml mode because people wanted to use <html:rewrite> in javascript which breaks with encoded ampersands.

David

Hi

Since getting hold of struts 1.1 RC2 I have been getting a problem with
the rewrite tag generating a url with the context root in twice.
I have seen that this error has been raised as an error under

http://issues.apache.org/bugzilla/show_bug.cgi?id=20835

upon looking at the code I have noticed that the class RewriteTag.java
has been changed between RC1 and RC2 to in clued the following

            // Note that we're encoding the & character to &amp; in
XHTML mode only,
            // otherwise the & is written as is to work in javascripts.
                                    url =
                                                RequestUtils.computeURL(
                                                            pageContext,
                                                            forward,
                                                            href,
                                                            page,
                                                            null,
                                                            params,
                                                            anchor,

!this.isXhtml());

My question is why is the isXhtml() value being passed as the redirect
parameter to computeURL, as this does not make sense, what has
redirecting the URL got to do with the encoding any & characters. And if
it is so important to do this then why was the same code not included in
the LinkTag which is still passing the redirect parameter as false.

Regards

David Wilkinson


_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail



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



Reply via email to