struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Graham" <dgraham1...@hotmail.com>
Subject Re: html:rewrite possible bug
Date Tue, 06 May 2003 17:25:13 GMT
Interesting, thanks for the info.  I found this previous bug:
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3281

The problem is that html:rewrite used outside of scripts should replace & 
with it's entity code and inside scripts in html documents it shouldn't.

What if we changed it to only use the entity code if the Struts tags are in 
XHTML mode?

David



>From: Tim Shadel <tim@zserve.com>
>Reply-To: "Struts Developers List" <struts-dev@jakarta.apache.org>
>To: struts-dev@jakarta.apache.org
>Subject: Re: html:rewrite possible bug
>Date: Tue, 06 May 2003 09:51:54 -0600
>
>Well, here's what the Mozilla people said:
>
>http://bugzilla.mozilla.org/show_bug.cgi?id=204533
>
>------- Additional Comments From bz-bugspam@mit.edu  2003-05-05 16:59 
>-------
>If the page is served as text/html, so we treat is as HTML (see 
>http://www.hixie.ch/advocacy/xhtml for a good summary of the reasons). In 
>HTML, scripts are PCDATA and so &amp; is _NOT_ converted to '&' in script 
>data.  Attributes are CDATA, so &amp; is converted to '&'.
>
>Now in XHTML (served as XML), scripts are CDATA, so the conversion should 
>happen -- one of the areas where XHTML is incompatible with HTML.  Since 
>you're citing the XHTML compatibility guidelines, I assume you read 
>http://www.w3.org/TR/xhtml1/#C_4 -- the example script in this bug MUST be 
>external for an XHTML document containing it to be labeled as text/html, 
>due to the above incompatibility.
>
>-----------------------------------------------------------------------
>
>My test.jsp is returning as text/html.  It seems like the &amp; is valid 
>for an attribute (e.g. <a href="">), but not necessarily vaild inside 
><script></script> tags.  Since this is where <html:rewrite> is useful
(see 
>the taglib docs for it), it appears that this duplicity is needed to 
>support JavaScript URLs.
>
>It also appears that if we used XHTML, we should use a separate file for 
><script> tags; especially if they contain the '&' symbol.
>
>I'm not an HTML/XML/XHTML spec guru, so I'd love to hear your responses, 
>and you're welcome to battle it out with the Mozilla people on the bug 
>listed above.
>
>In the meantime, pages still break when Struts is used for encoding URLs in 
>JavaScript.  That requires users of Struts to basically recreate the 
>functionality of the tag in scriptlet code -- bypassing the whole point of 
>the tag.
>
>If both the Struts crew and the Mozilla crew hold their ground, it's the 
>Struts users that suffer.  Hopefully this issue can be resolved, and the 
>right party will make the change.
>
>--Tim
>
>Nathan Bubna wrote:
>>Tim said:
>>
>>>>Both tags use RequestUtils.computeURL() to generate the url.
>>>
>>> >That method encodes ampersands if it is not a redirect.  This is
>>
>>the
>>
>>> >correct behavior.
>>> >
>>> >David
>>>
>>>I dunno.
>>
>>...
>>
>>http://www.w3.org/TR/xhtml1/#C_12
>>
>>Nathan Bubna
>>nathan@esha.com
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-dev-help@jakarta.apache.org
>


_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Mime
View raw message