Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-2120

StringIndexOutOfBoundsException computing relative paths for certain Resources

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 5.3, 5.4
    • 5.4
    • tapestry-core, tapestry-ioc
    • None

    Description

      Discoverred as part of CSS URL rewriting.

      With a base resource of "context:css/style.css"
      a relative URL of "../images/icon.gif"
      will fail with StringIndexOutOfBounds exception.

      java.lang.AbstractStringBuilder.setLength(AbstractStringBuilder.java:173)
      java.lang.StringBuilder.setLength(StringBuilder.java:72)
      org.apache.tapestry5.ioc.internal.util.AbstractResource.forFile(AbstractResource.java:104)
      org.apache.tapestry5.internal.services.AssetSourceImpl.findResource(AssetSourceImpl.java:241)
      org.apache.tapestry5.internal.services.AssetSourceImpl.getAssetInLocale(AssetSourceImpl.java:222)
      org.apache.tapestry5.internal.services.AssetSourceImpl.getAsset(AssetSourceImpl.java:104)
      org.apache.tapestry5.internal.services.assets.CSSURLRewriter.replaceURLs(CSSURLRewriter.java:145)
      

      Basically, it can't handle the fact that context: URLs don't have to start with a leading slash. Maybe they should, but that would break backwards compatibility.

      Attachments

        Activity

          People

            hlship Howard Lewis Ship
            hlship Howard Lewis Ship
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: