Yeah it is. You can use the <asset> xml spec method, or the asset
annotation. They resolve relatively to your component/page/whatever.

On 3/24/06, Mike Snare <[EMAIL PROTECTED]> wrote:
>
> Is there a service/utility that can be used by a page/component to
> retrieve an asset by relative path?
>
> I've got it working using the following code:
>
> private IAsset getPrivateAsset(String relativePath) {
>
>   String path = "/path/to/my/class/" + relativePath;
>
>   // resolver is a DefaultClassResolver
>   // the asset service is injected
>   return new PrivateAsset(new ClasspathResource(resolver, path),
>         getAssetService(), this.getLocation());
> }
>
> But it smells like a hack.
>
> Thanks,
> -Mike
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.  http://opennotion.com

Reply via email to