Resouce plugin does not display https correctly

I am trying to use groovyPageRenderer.render () to render a temple with a model so that I can send this rendered HTML with sendMail {}. Some of the banners we have include images, and we add them using something like:

${resource(dir: 'images/email', file: 'background_body.gif', absolute: true)} 

This is all good and works great in development. However, we want to run the application on top of https and despite the fact that to install grails.serverURL on "https://ourwebsite.com" (as indicated by the documents for the Closure resource in ApplicationTagLib.groovy [from grails-plugin-gsp ]), it is still trying to provide resources as accessible via http (which is not available), only through https.

+4
source share
1 answer

Based on this comment from the Resources plugin source, it looks like the resource() plugin tag does not support attr absolute support. If you are using Grails v2.0 or higher, Grails LinkGenerator can be a workaround. It is introduced as grailsLinkGenerator and can be called as follows: grailsLinkGenerator.resource(dir: '...', file: '...', absolute: true)

+1
source

Source: https://habr.com/ru/post/1447510/


All Articles