${asset:/com/apl/web/static/images/myimage.gif} The prefixes are just for references from the client side, not for code.
Also, you should incorporate a version number when mapping: public static void contributeClasspathAssetAliasManager( MappedConfiguration<String, String> configuration){ String version = . . . ; configuration.add(version + "/webimages", "com/apl/web/static/images/"); } On Tue, Jan 20, 2009 at 8:06 AM, Peter Stavrinides <p.stavrini...@albourne.com> wrote: > Hi > > Sorry about the trivial question, but I have just spent far to much time > trying to figure this out... I am sure I am missing something blindingly > simple: > > I am trying to contribute an alias and retrieve an image from the classpath, > like this: > > public static void contributeClasspathAssetAliasManager( > MappedConfiguration<String, String> configuration){ > configuration.add("webimages", "com/apl/web/static/images/"); > } > > In my .tml file I can get at the image like this: > <img src="../assets/webimages/myimage.gif" /> > > Or if I hardcode the application context like this: > /myapp/assets/webimages/myimage.gif > > But I need Tapestry to give me the /myapp/ part... I tried all sorts of > things, I assumed I could use ${asset:context:/webimages/myimages.gif}, but > that didn't work, any ideas? > > Thanks for your help, > Peter > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Howard M. Lewis Ship Creator Apache Tapestry and Apache HiveMind --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org