Can you put your assets in src/main/resources/META-INF/assets/ ? If so, then ClasspathAsset will work. Eg
public String getCongratulationsImg() { Asset asset = assetSource.getClasspathAsset( "/META-INF/assets/images/congratulations.png", currentLocale); return asset.toClientURL(); } Geoff > On 16 Dec 2015, at 10:38 pm, Jens Breitenstein <mailingl...@j-b-s.de> wrote: > > Hi all! > > I am struggling with the new asset behaviour in T5.4 and maybe one of you can > point me in the right direction > > When using an asset directly from a TML > > <div style="background:url(${asset:img/my.png});"> > > the image is correctly located and shown. The URL has been replaced to: > url(/new/assets/meta/595abbf1/img/my.png) as described in the docs. > To allow a dynamic change of the background image I thought using AssetSource > might be of help, but unfortunately I did not find a way to locate the image. > In my method I tried > > return _assetSource.getContextAsset("img/my.png",null).toClientURL(); > > but regardless if I use ContextAsset, ClasspathAsset or context:img.. or > context:asset:img.. the image is not found by Tapestry. > Any idea what I am doing wrong? > > > Thanks in advance > > Jens > >