Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-970

AssetEncoder fails to encode properly if path does not start with /

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.0.1
    • 4.1.1
    • Framework
    • None
    • JDK 1.5.0_06, Tomcat 5.5.16, Linux 2.6

    Description

      Assets, which do not start with a /, are not properly encoded with the AssetEncoder when using Friendly URL's.

      When injecting a script, inside of the Classpath via the @InjectScript, we are seeing that the path is a relative path. IE, "com/company/components/ColorPicker.script". There is no / like on the Form component for its external script injections. In the asset encoder.

      The asset encoder assumes that the path starts with a /. You will then get the digest and the path collide because there is no seperator. There needs to be a check somewhere for this.

      AssetEncoder.java, Line 49

      // _path ends with a slash, path starts with one.

      // simple workaround, aviods copying path and uses literals
      String pathSeperator = "";
      if (!path.startsWith("/")) pathSeperator = "/";

      String fullPath = _path + "/" + digest + pathSeperator + path;

      Attachments

        Activity

          People

            Unassigned Unassigned
            curtis.paris@gmail.com Curtis Paris
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: