tapestry-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Trewin" <...@canfactory.com>
Subject RE: Creating an IAsset in code from a context image
Date Fri, 02 Sep 2005 14:08:46 GMT
Thanks Geoff - just the ticket. 

-----Original Message-----
From: Geoff Longman [mailto:glongman@gmail.com] 
Sent: 31 August 2005 17:56
To: Tapestry users
Subject: Re: Creating an IAsset in code from a context image

public IAsset createAsset(ServletContext context, String path) {
  return new ContextAsset( new ContextResourceLocation(context, path),
null); }

there you go.

Geoff

On 8/31/05, Joe Trewin <joe@canfactory.com> wrote:
> Hi,
> 
> I'm tring to do a very simple thing, so I'm obviously missing 
> something here (using Tapestry 4).
> 
> I have a method which needs to return an IAsset that points to an 
> image (assume located somewhere in the web context) based on some 
> other parameters. The method is passed the component that requires the
asset.
> 
> I don't want the asset to be formally declared via a component or page

> specification file, as it's determined on the fly.
> 
> How do I do this?
> 
> I've seen hints that point towards using ContextAsset in some way, but

> can not find an obvious way to create one (the constructor takes 
> parameters that I don't know how to obtain, ie.
> "org.apache.hivemind.Resource" and "org.apache.hivemind.Location").
> Likewise with the 'ContextAssetFactory', although I'm not sure if 
> that's designed to be used outside of the core of Tapestry.
> 
> Seems simple enough, but ...
> 
> Any help gratefully recieved.
> 
> (NB. If the code needed to reference an image stored somewhere on the 
> classpath would this be a "private asset". If so, how might the code
> change?)
> 
> Joe
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 


-- 
The Spindle guy.           http://spindle.sf.net
Get help with Spindle:   
http://lists.sourceforge.net/mailman/listinfo/spindle-user
Announcement Feed:    
http://www.jroller.com/rss/glongman?catname=/Announcements
Feature Updates:            http://spindle.sf.net/updates

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Mime
View raw message