Details

    • Type: Sub-task Sub-task
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 2.1.0
    • Fix Version/s: 3.0.0
    • Component/s: extras
    • Labels:
      None

      Description

      All (most of) links in Click are "context-aware" i.e. /link will be converted to /servletcontextpath/link

      but
      ExternalLink is different.

      It uses link (targetPath) "as is" without any modifications.

      It is unexpected behavior.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        1354d 16h 11m 1 Adrian A. 03/Nov/13 11:18
        Adrian A. made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Won't Fix [ 2 ]
        Hide
        Adrian A. added a comment -

        This component should be removed and the required "external" functionality should be part of the Link control. See #CLK-543

        Show
        Adrian A. added a comment - This component should be removed and the required "external" functionality should be part of the Link control. See # CLK-543
        Adrian A. made changes -
        Fix Version/s 3.0.0 [ 12315124 ]
        Adrian A. made changes -
        Field Original Value New Value
        Parent CLK-543 [ 12424287 ]
        Issue Type Bug [ 1 ] Sub-task [ 7 ]
        Hide
        Andrew Fink added a comment -

        >Finn Bock
        >I wouldn't want any modification made to a targetPath like "http://www.google.com/". It should be used as href exactly as is.

        Don't be afraid

        What I mean:
        ===
        http://click.apache.org/docs/user-guide/htmlsingle/click-book.html#redirect

        "If the redirect location begins with a "/" character the redirect location will be prefixed with the web applications context path. For example if an application is deployed to the context "mycorp" calling setRedirect("/customer/details.htm") will redirect the request to: "/mycorp/customer/details.htm".
        ===

        Same can apply to ExternalLink.

        If target path == http://www.google.com/ or www.google.com/ or foobar then it will be used as is - without modifications.
        But if target path starts with / then - it is of course on your server,
        but usually wrong: http://myserver/target_path
        instead of (right): http://myserver/servletcontextpath/target_path

        You don't know usually servletcontextpath in your webApp (you should call getContextPath()) and i think you rarely need something in others webapps.

        Show
        Andrew Fink added a comment - >Finn Bock >I wouldn't want any modification made to a targetPath like "http://www.google.com/". It should be used as href exactly as is. Don't be afraid What I mean: === http://click.apache.org/docs/user-guide/htmlsingle/click-book.html#redirect "If the redirect location begins with a "/" character the redirect location will be prefixed with the web applications context path. For example if an application is deployed to the context "mycorp" calling setRedirect("/customer/details.htm") will redirect the request to: "/mycorp/customer/details.htm". === Same can apply to ExternalLink. If target path == http://www.google.com/ or www.google.com/ or foobar then it will be used as is - without modifications. But if target path starts with / then - it is of course on your server, but usually wrong: http://myserver/target_path instead of (right): http://myserver/servletcontextpath/target_path You don't know usually servletcontextpath in your webApp (you should call getContextPath()) and i think you rarely need something in others webapps.
        Hide
        Malcolm Edgar added a comment -

        +1 on another constructor

        Show
        Malcolm Edgar added a comment - +1 on another constructor
        Hide
        Finn Bock added a comment -

        I wouldn't want any modification made to a targetPath like "http://www.google.com/". It should be used as href exactly as is.

        Regarding the missing constructor, I agree. The 2 most common pieces of information on a ExternalLink is the href and the label so it would be nice to a constructor for that.

        IMO the only surprising thing about ExternalLink is its location in the extras package.

        Show
        Finn Bock added a comment - I wouldn't want any modification made to a targetPath like "http://www.google.com/". It should be used as href exactly as is. Regarding the missing constructor, I agree. The 2 most common pieces of information on a ExternalLink is the href and the label so it would be nice to a constructor for that. IMO the only surprising thing about ExternalLink is its location in the extras package.
        Hide
        Andrew Fink added a comment -

        And also ExternalLink doesn't have handy constructor:

        public ExternalLink(String name, String targetPath, String label)

        It looks just like mistake.

        Show
        Andrew Fink added a comment - And also ExternalLink doesn't have handy constructor: public ExternalLink(String name, String targetPath, String label) It looks just like mistake.
        Andrew Fink created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Andrew Fink
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development