Return-Path: Delivered-To: apmail-jakarta-tapestry-user-archive@www.apache.org Received: (qmail 40662 invoked from network); 2 Sep 2005 14:08:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Sep 2005 14:08:59 -0000 Received: (qmail 2997 invoked by uid 500); 2 Sep 2005 14:08:53 -0000 Delivered-To: apmail-jakarta-tapestry-user-archive@jakarta.apache.org Received: (qmail 2986 invoked by uid 500); 2 Sep 2005 14:08:53 -0000 Mailing-List: contact tapestry-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Tapestry users" Reply-To: "Tapestry users" Delivered-To: mailing list tapestry-user@jakarta.apache.org Received: (qmail 2968 invoked by uid 99); 2 Sep 2005 14:08:52 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Sep 2005 07:08:52 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [212.111.35.164] (HELO dev.canfactory.com) (212.111.35.164) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 02 Sep 2005 07:09:06 -0700 Received: from canfactory.com ([10.10.10.10]) by dev.canfactory.com (SMSSMTP 4.0.0.59) with SMTP id M2005090215084603378 for ; Fri, 02 Sep 2005 15:08:46 +0100 Content-class: urn:content-classes:message Subject: RE: Creating an IAsset in code from a context image MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Fri, 2 Sep 2005 15:08:46 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Message-ID: <506835016D13BB498C206DFE3EE48DDF09D61F@alfred.Springfield.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Creating an IAsset in code from a context image thread-index: AcWuTPFY3qG+MRq9SGqGOOgqOJ6VFQBetr9g From: "Joe Trewin" To: "Tapestry users" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Thanks Geoff - just the ticket.=20 -----Original Message----- From: Geoff Longman [mailto:glongman@gmail.com]=20 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 wrote: > Hi, >=20 > I'm tring to do a very simple thing, so I'm obviously missing=20 > something here (using Tapestry 4). >=20 > I have a method which needs to return an IAsset that points to an=20 > image (assume located somewhere in the web context) based on some=20 > other parameters. The method is passed the component that requires the asset. >=20 > I don't want the asset to be formally declared via a component or page > specification file, as it's determined on the fly. >=20 > How do I do this? >=20 > 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=20 > 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=20 > that's designed to be used outside of the core of Tapestry. >=20 > Seems simple enough, but ... >=20 > Any help gratefully recieved. >=20 > (NB. If the code needed to reference an image stored somewhere on the=20 > classpath would this be a "private asset". If so, how might the code > change?) >=20 > Joe >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org >=20 >=20 --=20 The Spindle guy. http://spindle.sf.net Get help with Spindle: =20 http://lists.sourceforge.net/mailman/listinfo/spindle-user Announcement Feed: =20 http://www.jroller.com/rss/glongman?catname=3D/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