You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Felix Scheffer (JIRA)" <ji...@apache.org> on 2014/08/04 16:53:12 UTC

[jira] [Comment Edited] (TAP5-2368) CSSURLRewriter should not attempt to rewrite urls in comments

    [ https://issues.apache.org/jira/browse/TAP5-2368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14084729#comment-14084729 ] 

Felix Scheffer edited comment on TAP5-2368 at 8/4/14 2:51 PM:
--------------------------------------------------------------

Oh my mistake. I wasn't aware of that. // always seemed to work.

But even if i use /* */ to comment out the line, Tapestry is still trying to rewrite the url inside the comment:

{code}
/*.cboxIE6 { background:url(images/ie6/borderTopLeft.png); }*/
{code}

{code}
Caused by: java.lang.RuntimeException: Unable to locate asset 'classpath:com/foobar/images/ie6/borderTopLeft.png' (the file does not exist).
	at org.apache.tapestry5.internal.services.AssetSourceImpl.getLocalizedAssetFromResource(AssetSourceImpl.java:376)
	at org.apache.tapestry5.internal.services.AssetSourceImpl.getAssetInLocale(AssetSourceImpl.java:309)
	at org.apache.tapestry5.internal.services.AssetSourceImpl.getAsset(AssetSourceImpl.java:131)
	at $AssetSource_24ccf1f0d81.getAsset(Unknown Source)
	at org.apache.tapestry5.internal.services.assets.CSSURLRewriter.replaceURLs(CSSURLRewriter.java:163)
	at org.apache.tapestry5.internal.services.assets.CSSURLRewriter.access$100(CSSURLRewriter.java:45)
	at org.apache.tapestry5.internal.services.assets.CSSURLRewriter$1.perform(CSSURLRewriter.java:106)
	at org.apache.tapestry5.internal.services.assets.CSSURLRewriter$1.perform(CSSURLRewriter.java:101)
	at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.perform(OperationTrackerImpl.java:110)
{code}

I am using 5.4-beta-16 (build from the source).

Regarding TAP5-2187, I dont think it's a duplicate. I really like the idea of throwing an exception when there's a missing asset in the css file. It just shouldn't be the case when that missing asset is commented out. I also dont understand the patch in TAP5-2187. Maybe I am missing something here, but it looks like that CSSURLRewriter expects AssetSource.getAsset() to return null when the asset is missing. But the documentation of AssetSource.getAsset() says "@throws RuntimeException if the asset can not be found"





was (Author: fscheffer):
Oh my mistaken. I wasn't aware of that. // always seemed to work.

But even if i use /* */ to comment out the line, Tapestry is still trying to rewrite the url inside the comment:

{code}
/*.cboxIE6 { background:url(images/ie6/borderTopLeft.png); }*/
{code}

{code}
Caused by: java.lang.RuntimeException: Unable to locate asset 'classpath:com/foobar/images/ie6/borderTopLeft.png' (the file does not exist).
	at org.apache.tapestry5.internal.services.AssetSourceImpl.getLocalizedAssetFromResource(AssetSourceImpl.java:376)
	at org.apache.tapestry5.internal.services.AssetSourceImpl.getAssetInLocale(AssetSourceImpl.java:309)
	at org.apache.tapestry5.internal.services.AssetSourceImpl.getAsset(AssetSourceImpl.java:131)
	at $AssetSource_24ccf1f0d81.getAsset(Unknown Source)
	at org.apache.tapestry5.internal.services.assets.CSSURLRewriter.replaceURLs(CSSURLRewriter.java:163)
	at org.apache.tapestry5.internal.services.assets.CSSURLRewriter.access$100(CSSURLRewriter.java:45)
	at org.apache.tapestry5.internal.services.assets.CSSURLRewriter$1.perform(CSSURLRewriter.java:106)
	at org.apache.tapestry5.internal.services.assets.CSSURLRewriter$1.perform(CSSURLRewriter.java:101)
	at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.perform(OperationTrackerImpl.java:110)
{code}

I am using 5.4-beta-16 (build from the source).

Regarding TAP5-2187, I dont think it's a duplicate. I really like the idea of throwing an exception when there's a missing asset in the css file. It just shouldn't be the case when that missing asset is commented out. I also dont understand the patch in TAP5-2187. Maybe I am missing something here, but it looks like that CSSURLRewriter expects AssetSource.getAsset() to return null when the asset is missing. But the documentation of AssetSource.getAsset() says "@throws RuntimeException if the asset can not be found"




> CSSURLRewriter should not attempt to rewrite urls in comments
> -------------------------------------------------------------
>
>                 Key: TAP5-2368
>                 URL: https://issues.apache.org/jira/browse/TAP5-2368
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.4
>            Reporter: Felix Scheffer
>
> The following css
> {code}
> //.cboxIE6 { background:url(images/ie6/borderTopLeft.png); }
> {code}
> causes 
> {code}
> java.lang.RuntimeException
> Unable to locate asset 'classpath:com/foobar/images/ie6/borderTopLeft.png' (the file does not exist).
> 	at org.apache.tapestry5.internal.services.AssetSourceImpl.getLocalizedAssetFromResource(AssetSourceImpl.java:376)
> 	at org.apache.tapestry5.internal.services.AssetSourceImpl.getAssetInLocale(AssetSourceImpl.java:309)
> 	at org.apache.tapestry5.internal.services.AssetSourceImpl.getAsset(AssetSourceImpl.java:131)
> 	at $AssetSource_2d82890f6e9d.getAsset(Unknown Source)
> 	at org.apache.tapestry5.internal.services.assets.CSSURLRewriter.replaceURLs(CSSURLRewriter.java:163)
> 	at org.apache.tapestry5.internal.services.assets.CSSURLRewriter.access$100(CSSURLRewriter.java:45)
> 	at org.apache.tapestry5.internal.services.assets.CSSURLRewriter$1.perform(CSSURLRewriter.java:106)
> 	at org.apache.tapestry5.internal.services.assets.CSSURLRewriter$1.perform(CSSURLRewriter.java:101)
> 	at org.apache.tapestry5.ioc.internal.OperationTrackerImpl.perform(OperationTrackerImpl.java:110)
> {code}
> even though it's commented out.



--
This message was sent by Atlassian JIRA
(v6.2#6252)