Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.0-RC1
    • Fix Version/s: None
    • Component/s: core / taglib.core
    • Labels:
      None

      Description

      The JellyContext assumes all URLs can be decomposed into a String, and then recomposed via a simple "new URL(urlString)" invocation. This causes significant problems when custom URL handlers are involved, since a user may have created a URL and passed in a custom URLHandler. In a case such as this, if the URL is reduced to a String any subsequent reification may result in either a MalformedURLException, or in a new URL with the default system URLHandler rather than the custom handler.

      Of primary concern are the following methods:
      createRelativeURL(URL, String)
      getJellyContextURL(InputSource)
      getJellyContextURL(URL)
      runScript(URL, XMLOutput, boolean, boolean)

      Attached is a subclass of JellyContext, URLFriendlyJellyContext, that resolves many URL-handling issues, assuming that the context is created with a valid URL, and subsequent operations (such as runScript()) pass String arguments that are either absolute or relative paths to be based upon the URL used to initialize the context.

      The content of URLFriendlyJellyContext can easily be merged into the JellyContext class, making JellyContext much more robust when handling custom URLs.

        Activity

        Thomas Burns created issue -
        Hide
        Thomas Burns added a comment -

        Sample solution to many of JellyContext's URL-handling issues

        Show
        Thomas Burns added a comment - Sample solution to many of JellyContext's URL-handling issues
        Thomas Burns made changes -
        Field Original Value New Value
        Attachment URLFriendlyJellyContext.java [ 19876 ]
        Hide
        John Spackman added a comment -

        The proposed solution is not ideal because (as the comments in the patch point out) JellyContext makes inappropriate assumptions about the format of a URL (i.e. that segments are separated by '/' characters) when chopping up and navigating the path. A better solution would be to define a JellyResourceLocator interface and have a default implementation that uses "standard" URLs.

        Propose this for v2.0

        Show
        John Spackman added a comment - The proposed solution is not ideal because (as the comments in the patch point out) JellyContext makes inappropriate assumptions about the format of a URL (i.e. that segments are separated by '/' characters) when chopping up and navigating the path. A better solution would be to define a JellyResourceLocator interface and have a default implementation that uses "standard" URLs. Propose this for v2.0

          People

          • Assignee:
            Unassigned
            Reporter:
            Thomas Burns
          • Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:

              Development