You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org> on 2013/05/29 18:54:20 UTC

[jira] [Created] (TAP5-2120) StringIndexOutOfBoundException on certain relative paths

Howard M. Lewis Ship created TAP5-2120:
------------------------------------------

             Summary: StringIndexOutOfBoundException on certain relative paths
                 Key: TAP5-2120
                 URL: https://issues.apache.org/jira/browse/TAP5-2120
             Project: Tapestry 5
          Issue Type: Bug
          Components: tapestry-core, tapestry-ioc
    Affects Versions: 5.3, 5.4
            Reporter: Howard M. Lewis Ship
            Priority: Blocker


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.

{code}
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)
{code}

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.





--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira