Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 4.1.1
    • Fix Version/s: 4.1.2
    • Component/s: XHR/dhtml/Ajax
    • Labels:
      None
    • Environment:
      WinXP. FireFox 2.0.

      Description

      The AjaxShellDelegate generates code like:

      <script type="text/javascript" src="/AJAXApp/app?service=asset&path=%2Fdojo%2Fdojo.js"></script>

      but the & is not escaped. It should be:

      <script type="text/javascript" src="/AJAXApp/app?service=asset&path=%2Fdojo%2Fdojo.js"></script>

      I think http://jakarta.apache.org/commons/codec/apidocs/org/apache/commons/codec/net/URLCodec.html should be used in the render() method in AjaxShellDelegate.

        Activity

        Hide
        Richard Pitt added a comment -

        EngineServiceLink line 226 defines the separator: sep = "&";

        I don't know if this code needs to sometimes escape the character and sometimes not.
        If not then this should fix it: sep = "&";

        Here is the stack trace:
        EngineServiceLink.addParameters(StringBuffer) line: 226
        EngineServiceLink.constructURL(StringBuffer, String, boolean) line: 187
        EngineServiceLink.getURL(String, boolean) line: 140
        EngineServiceLink.getURL() line: 135
        PrivateAsset.buildURL() line: 72
        AjaxShellDelegate.render(IMarkupWriter, IRequestCycle) line: 91
        $Shell_136(Shell).renderComponent(IMarkupWriter, IRequestCycle) line: 109
        $Shell_136(AbstractComponent).render(IMarkupWriter, IRequestCycle) line: 710
        DefaultResponseBuilder.render(IMarkupWriter, IRender, IRequestCycle) line: 174
        $Home_106(BaseComponent).renderComponent(IMarkupWriter, IRequestCycle) line: 92

        Show
        Richard Pitt added a comment - EngineServiceLink line 226 defines the separator: sep = "&"; I don't know if this code needs to sometimes escape the character and sometimes not. If not then this should fix it: sep = "&"; Here is the stack trace: EngineServiceLink.addParameters(StringBuffer) line: 226 EngineServiceLink.constructURL(StringBuffer, String, boolean) line: 187 EngineServiceLink.getURL(String, boolean) line: 140 EngineServiceLink.getURL() line: 135 PrivateAsset.buildURL() line: 72 AjaxShellDelegate.render(IMarkupWriter, IRequestCycle) line: 91 $Shell_136(Shell).renderComponent(IMarkupWriter, IRequestCycle) line: 109 $Shell_136(AbstractComponent).render(IMarkupWriter, IRequestCycle) line: 710 DefaultResponseBuilder.render(IMarkupWriter, IRender, IRequestCycle) line: 174 $Home_106(BaseComponent).renderComponent(IMarkupWriter, IRequestCycle) line: 92
        Hide
        Jesse Kuhnert added a comment -

        Sure - as I've said before....As soon as someone gives me a solution that works I'll be happy to add it in.

        Show
        Jesse Kuhnert added a comment - Sure - as I've said before....As soon as someone gives me a solution that works I'll be happy to add it in.
        Hide
        Richard Pitt added a comment -

        For the record, this seems to be a general bug with all references to dojo resources, and is stopping us using HtmlUnit to test our tapestry application.

        Show
        Richard Pitt added a comment - For the record, this seems to be a general bug with all references to dojo resources, and is stopping us using HtmlUnit to test our tapestry application.
        Hide
        Jesse Kuhnert added a comment -

        As no one has volunteered to do anything about this I'm closing it out.

        Show
        Jesse Kuhnert added a comment - As no one has volunteered to do anything about this I'm closing it out.
        Hide
        Kent Tong added a comment -

        A quick search in Google with "w3c validator government policy" shows that the Canada government requires every one of its web sites be validated (http://www.apt.gc.ca/dProcClausesE.asp?Id=576). Anyone doing work for them has to comply.

        Show
        Kent Tong added a comment - A quick search in Google with "w3c validator government policy" shows that the Canada government requires every one of its web sites be validated ( http://www.apt.gc.ca/dProcClausesE.asp?Id=576 ). Anyone doing work for them has to comply.
        Hide
        Jesse Kuhnert added a comment -

        I'm not sure how much of an impact that is. How many people run their apps inside the w3c validator?

        If something were broken in an actual web browser I would be more concerned, but as it stands now I've made a first pass at "fixing" it but have not been able to yet so again should say that if anyone feels strongly about it they are free to give it a go but I'm too busy to play to the petty w3c validator gods right now.

        Show
        Jesse Kuhnert added a comment - I'm not sure how much of an impact that is. How many people run their apps inside the w3c validator? If something were broken in an actual web browser I would be more concerned, but as it stands now I've made a first pass at "fixing" it but have not been able to yet so again should say that if anyone feels strongly about it they are free to give it a go but I'm too busy to play to the petty w3c validator gods right now.
        Hide
        Kent Tong added a comment -

        Well, the impact is that all T4.1 generated pages are broken as indicated by the w3c HTML validator (http://validator.w3.org).

        Show
        Kent Tong added a comment - Well, the impact is that all T4.1 generated pages are broken as indicated by the w3c HTML validator ( http://validator.w3.org ).
        Hide
        Jesse Kuhnert added a comment -

        I did make an attempt at changing this yesterday but couldn't find an easy solution to whatever the problem is. (seeing as how it works in all known browsers and all)

        If someone feels like fixing it they are more than welcome to, but I am probably not going to look at it again for a while.

        Show
        Jesse Kuhnert added a comment - I did make an attempt at changing this yesterday but couldn't find an easy solution to whatever the problem is. (seeing as how it works in all known browsers and all) If someone feels like fixing it they are more than welcome to, but I am probably not going to look at it again for a while.
        Hide
        Kent Tong added a comment -

        I am not sure if I am following you. I just viewed the source of this jira page, the URLs are indeed showing & which is the way it should be.

        Show
        Kent Tong added a comment - I am not sure if I am following you. I just viewed the source of this jira page, the URLs are indeed showing & which is the way it should be.
        Hide
        Jesse Kuhnert added a comment -

        Yeah, but I don't think that's where we disagree. . Even if you do "view page source" on one of these JIRA pages you'll find that & symbols in href url query sections are visually seen as & - which is exactly how AjaxShellDelegate renders the symbols. If you actually saw the character string rendered in html source as "&" the url would be invalid.

        So, again....I'm not seeing what is broken here.

        Show
        Jesse Kuhnert added a comment - Yeah, but I don't think that's where we disagree. . Even if you do "view page source" on one of these JIRA pages you'll find that & symbols in href url query sections are visually seen as & - which is exactly how AjaxShellDelegate renders the symbols. If you actually saw the character string rendered in html source as "&" the url would be invalid. So, again....I'm not seeing what is broken here.
        Hide
        Andreas Andreou added a comment -

        we all see the first example, but according to
        http://www.w3.org/TR/html4/appendix/notes.html#h-B.2.2 and
        http://www.htmlhelp.com/tools/validator/problems.html#amp
        the second is the correct way...

        I remember we had fixed this in 4.0.x - don't know how it reappeared.

        Show
        Andreas Andreou added a comment - we all see the first example, but according to http://www.w3.org/TR/html4/appendix/notes.html#h-B.2.2 and http://www.htmlhelp.com/tools/validator/problems.html#amp the second is the correct way... I remember we had fixed this in 4.0.x - don't know how it reappeared.
        Hide
        Jesse Kuhnert added a comment -

        Are you guys sure about this? AjaxShellDelegate is just calling IAsset.buildURL() , which in turn calls AssetService.getLink() which uses all of the normal tapestry URL encoding resources to properly encode url's.

        The end result that I see with friendly urls turned off is the first example that Kent shows, which is correct. If it were actually rendered as & the browser would correctly detect this to be an escape symbol and ignore it instead of using it as a valid character to implement the http protocol for query parameters.

        Am I missing something?

        Show
        Jesse Kuhnert added a comment - Are you guys sure about this? AjaxShellDelegate is just calling IAsset.buildURL() , which in turn calls AssetService.getLink() which uses all of the normal tapestry URL encoding resources to properly encode url's. The end result that I see with friendly urls turned off is the first example that Kent shows, which is correct. If it were actually rendered as & the browser would correctly detect this to be an escape symbol and ignore it instead of using it as a valid character to implement the http protocol for query parameters. Am I missing something?
        Hide
        Andreas Andreou added a comment -

        Note: one has to disable friendly urls to see this

        Show
        Andreas Andreou added a comment - Note: one has to disable friendly urls to see this

          People

          • Assignee:
            Unassigned
            Reporter:
            Kent Tong
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development