On Monday 15 Aug 2005 21:37, Vjeran Marcinko wrote:
> ----- Original Message -----
> From: "Kent Tong" <[EMAIL PROTECTED]>
> To: <tapestry-user@jakarta.apache.org>
> Sent: Monday, August 15, 2005 7:05 PM
> Subject: Re: Confused about asset prefix
>
> > class MyComponent {
> >  @Asset("classpath:images/001.gif")
> >  public abstract IAsset getMyAsset();
> > }
> >
> > There is such an example in chapter 6 of my book (but it uses <asset>,
> > not @Asset).
>
> Dunno how you managed to do that, since I tried using "classpath" prefix in
> both beta3 and beta4, and in both versions it didn't work. I checked my
> /WEB-INF/classes/.../whatever directory, and it did contain .gif that I
> tried to reference, but it doesn't work. I tried all possible referencing,
> relative and absolute...starting with slash, and without it...
> Here's the bug report:
> http://issues.apache.org/jira/browse/TAPESTRY-412

I have been using it all evening, since I learnt about it from the previous 
post.

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.




-- 
Alan Chandler
http://www.chandlerfamily.org.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to