You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Niall Pemberton <ni...@blueyonder.co.uk> on 2005/11/07 21:36:48 UTC

Encoding Query Parameter Separators (Bug 36774)

Since Struts 1.1 the ampersand spearator in query parameters has been
encoded as "&amp;" (rather than just "&") in the LinkTag.

Does anyone know why we do this? The only thing I could find is the the
following:

   http://www.w3.org/TR/html4/appendix/notes.html#h-B.2.2

Are there any other reasons? Also the TagUtils.computeURLWithCharEncoding()
method that does this doesn't do it for redirects - why is that?

Niall



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


Re: Encoding Query Parameter Separators (Bug 36774)

Posted by Laurie Harper <la...@holoweb.net>.
Niall Pemberton wrote:
> Since Struts 1.1 the ampersand spearator in query parameters has been
> encoded as "&amp;" (rather than just "&") in the LinkTag.
> 
> Does anyone know why we do this? The only thing I could find is the the
> following:
> 
>    http://www.w3.org/TR/html4/appendix/notes.html#h-B.2.2

If the ampersands were not escaped, the result wouldn't be valid HTML. I 
would guess that's why it was changed to the current behaviour.

> Are there any other reasons? Also the TagUtils.computeURLWithCharEncoding()
> method that does this doesn't do it for redirects - why is that?

A client-side redirect is sent as an HTTP header, not a complete HTML 
document, so escaping isn't required in that case.

L.


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