----- Original Message -----
From: "Alan Chandler" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Tuesday, August 16, 2005 12:47 AM
Subject: Re: Confused about asset prefix
All paths are relative to the context path
I have a library specification at
WEB-INF/classes/uk/org/chandlerfamily/tapestry/components/akc.library
That simply locates that component classes at the same level thus.
<library-specification>
<meta key="org.apache.tapestry.component-class-packages">
uk.org.chandlerfamily.tapestry.components
</meta>
</library-specification>
At this level, is my component class Border.java, I have some some assets
defined
// Style Sheet
@Asset("context:/styles/border.css")
public abstract IAsset getSiteStyle();
// Heading Images
@Asset("images/coal.png")
public abstract IAsset getLeftHeadImg();
The first of these is located in
styles/border.css
The second of these is located in
WEB_INF/classes/uk/org/chandlerfamily/tapestry/components/images/coal.png
All is working perfectly.
Here is my case....
My component's path is located at :
/WEB-INF/classes/article/crud/tapestry/MyComponent.jwc
and inside it I have:
<asset name="info" path="classpath:info-icon.gif"/>
since this .gif is located also in this same directory:
/WEB-INF/classes/article/crud/tapestry/info-icon.gif
and it raises :
java.lang.ClassCastException
at
org.apache.tapestry.asset.ClasspathAssetFactory.createAsset(ClasspathAssetFactory.java:46)
OK, so I thought maybe this relative location doesn't work, let's try :
<asset name="info" path="classpath:article/crud/tapestry/info-icon.gif"/>
and this time it raises different error report:
Unable to locate asset 'article/crud/tapestry/info-icon.gif' relative to
context:/WEB-INF/classes/article/crud/tapestry/MyComponent.jwc
NOW, please don't tell me that I have to explicitly configure Tapestry with
some global path setting JUST for this thing ?! That would most surely be
annoying... I just want this component to reference this damn gif that is
packaged beside it. ;)
<private-asset> in 3.0 worked well with this as I recall.
-Vjeran
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]