You have a typo: absolute='true'
instead of absolute: true
.
So, correct:
${g.resource(dir:"images" , file:"logo.png", absolute: true ) }
If you use it in template, also try <g:resource dir="images" file="logo.png" absolute="true"/>
Pergunta
I'm actually working on sending a notification mail in my Grails application.
the problem which I'm facing is that i need to have the absolute path of an image resource in order to have it appears in my mail
so in my mail template i used the following :
${resource(dir:"images" , file:"logo.png", absolute="true" ) }
but i'm always getting this instead of the full path to the resource
static/images/logo.png
instead of
http://localhost:8080/myApp/static/images/logo.png
how can i obtain the absolute url ?
Solução
You have a typo: absolute='true'
instead of absolute: true
.
So, correct:
${g.resource(dir:"images" , file:"logo.png", absolute: true ) }
If you use it in template, also try <g:resource dir="images" file="logo.png" absolute="true"/>