|
Okay, this may be my understanding, but if I go to... http://validator.w3.org/#validate_by_input ...and enter... <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ...then I get errors (note the DOCTYPE is HTML, not XHTML). But if I escape the So this would seem to suggest unescaped ampersands are not valid HTML? Well the initial gripe about the unescaped ampersand is a warning. We can look into changing the renderers to make the validator happy. As I said, if you want to do that now, use XHTML transitional for your response Okay, so how do I set my response content type to XHTML? My JSP page contains I tried... <context-param> ...but I still get an unescaped ampersand. Using JSP you can set the content type by specifying the contentType attribute So it sounds like setting the content type in a Filter is probably the easiest Just to clarify the 'com.sun.faces.preferXHTML' option. That's there for Well, given how inelegant it is to work around this problem, could I request Your comment that 'the unescaped ampersand is only a warning' seems a bit http://www.w3.org/TR/html401/charset.html#h-5.3.2 ...where is says... "Authors should also use "&" in attribute values since character references >Well, given how inelegant it is to work around this problem, could I request I previously stated that we'd look into it. >Your comment that 'the unescaped ampersand is only a warning' seems a bit It wasn't at all. The validator said it was a warning. A warning is not an > http://www.w3.org/TR/html401/charset.html#h-5.3.2 'should' is not 'must'. That said, I think this section is probably more relevant: http://www.w3.org/TR/html4/appendix/notes.html#ampersands-in-uris > I previously stated that we'd look into it. Great, thanks. > That said, I think this section is probably more relevant Agreed. And, in fact, in that section it really does say 'must', not 'should': "For example, to use the URI "http://host/?x=1&y=2" as a linking URI, it must Look forward to your decision regarding 1.2/2.0. Thanks for your time and all Created an attachment (id=710) Awesome. Thanks guys. Richard. Changes applied to 1.2 and 2.0. |
|||||||||||||||||||||||||||||||||||||||||||||||||
It will escape the ampersands in the URL if the response content type is XHTML,
otherwise, it will leave them as is, which is, as far as I can tell, perfectly
acceptable.