You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ariel Pablo Klein <ap...@luminafinance.com> on 2003/02/06 18:47:58 UTC

Browsers doesn't respond with incorrect URL encoding

This is with Tapestry 2.3RC1

What was the idea of encode the entire URL when the only that you need
to encode are the parameter values?

For example if you have this URL:
http://localhost/mainServlet?service=direct&sp=value1 , you don't need
reeconde it because if you do it, youll be encoding & to &amp; that's
unnecesary and wrong, and in my experience sometimes the browser doesn't
execute click event, but works fine while I do shift-click opening in a
new window. Other example can be about encoding # (anchor char), the #
mustn't be enconded.


This error is a misuse of links or it's a bug?


net.sf.tapestry.Gesture class

   private String constructURL(StringBuffer buffer, boolean
includeParameters)
    {

	.......................
	.......................
	.......................

        if (_stateful)
            result = _cycle.encodeURL(result);

        return result;
    }


Note: The same happends with IE and Opera, and ive installed
HTTPInspector from Freakysoft, that works as proxyserver and it shows
every request made by the browser, and when the url its "malformed", the
browser never sends the request to the server.

Thanks
Ariel Pablo Klein

Pd: my english its poor.

RE: Browsers doesn't respond with incorrect URL encoding

Posted by "Howard M. Lewis Ship" <hl...@attbi.com>.
A well formed HTML document will escape all instances of HTML entities (such
as '<' and '&') anywhere they appear in the document, even inside an HTML
attribute.

Browsers will see expanded entities (such as '&amp;' and convert to
individual characters ('&') internally.  Thus, a subsequent HTTP GET or POST
will send a single character ('&') not the sequence ('&amp;').

Most browsers bend over backwards to support invalid HTML (one of the great
idiocies of the web).  In many cases, the '&' passes through ok.  I've seen
problems in versions of IE where IE would see a sequence such as
'&amperes=10' and (even though the entity was not terminated) convert this
to "&eres=10", causing havoc when the request was submitted.  Encoding this
as "&amp;amperes=10" is correct and entirely unambiguous.

I suspect that what you are doing is copying the URL visible in "View
Source" and pasting it into the address field of your browser.  You can
expect errors if you do that; errors you will not see if you clicked the
actual link in the rendered HTML page.

If this is not the case, please provide more exact details!  I have been
learning to my chagrin that some aspects of HTML/HTTP, specifically
involving non-latin character sets and code pages, cause a great deal of
grief.  If there is a latent bug in this, it is likely related to
non-English (and non-Latin) browsers.  We've worn a pretty deep groove
through ordinary web servers and browsers, at least among English speakers.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/proposals/tapestry



-----Original Message-----
From: Ariel Pablo Klein [mailto:apklein@luminafinance.com] 
Sent: Thursday, February 06, 2003 12:48 PM
To: Tapestry users
Subject: Browsers doesn't respond with incorrect URL encoding


This is with Tapestry 2.3RC1

What was the idea of encode the entire URL when the only that you need to
encode are the parameter values?

For example if you have this URL:
http://localhost/mainServlet?service=direct&sp=value1 , you don't need
reeconde it because if you do it, youll be encoding & to &amp; that's
unnecesary and wrong, and in my experience sometimes the browser doesn't
execute click event, but works fine while I do shift-click opening in a new
window. Other example can be about encoding # (anchor char), the # mustn't
be enconded.


This error is a misuse of links or it's a bug?


net.sf.tapestry.Gesture class

   private String constructURL(StringBuffer buffer, boolean
includeParameters)
    {

	.......................
	.......................
	.......................

        if (_stateful)
            result = _cycle.encodeURL(result);

        return result;
    }


Note: The same happends with IE and Opera, and ive installed HTTPInspector
from Freakysoft, that works as proxyserver and it shows every request made
by the browser, and when the url its "malformed", the browser never sends
the request to the server.

Thanks
Ariel Pablo Klein

Pd: my english its poor.

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