Hello all,
 
I am trying to create a getter that returns the relative path to the images
directory for my application. I want it to apply in template HTML files as:
 
    <img src="${imagesBase}/some_image.jpg"/>
 
I found a previous thread (
http://www.nabble.com/T5-How-to-difine-dynamic-path-for-image-t4834269.html
) on how to do this using AssetSource but this did not work for me as it
requires the java class to know the exact resource location. This isn't
beneficial when work is passed on to web designers who do not have any
programming experience, nor should have to.
 
I have also tried the following java code but I keep getting runtime errors
 
    @Inject
    @Path("context:images")
    private Asset imagesBase;
 
    public Asset getImagesBase() { return imagesBase; }
 
Any help on this would be great. Thanks.
 
Jean-Philippe Steinmetz

Reply via email to