Search code examples
tapestry

How should i post a picture with asset in tapestry?


[enter image description here]

My pictures are situated in the folder 'images' which is a subfolder of 'layout' folder.
I placed the following line of code in my .tml page:

<img src="${asset:layout:/images/img01.jpg}"/>

But i get this error: Could not convert 'asset:layout:/images/img01.jpg' into a component parameter binding: Unknown prefix for asset path 'layout:/images/img01.jpg'.

What should i do in this case because i have tried to move my pictures in other folders but the error appears again!


Solution

  • Try <img src="${asset:context:/layout/images/img01.jpg}"/> instead. Tapestry is right, layout: is not a valid prefix, it should be part of your path instead.