我正在使用Groovy和Grails编程门户,以显示不同的pdf页面。在一种情况下,我需要从pdf内的数据库中显示图像。
对于pdf创建,我使用pdf 0.6
该插件生成pdf,但.gsp中的图像不会显示:
<img style="height: 100px; float: right;" src="${grailsApplication.config.grails.tomcatURL}${createLinkTo(controller: 'mandant', action: 'logo_image', id: mandant.id)}"
调用控制器的.gsp ingnores,因为我在方法中有一些println,所以我可以确定.gsp不会调用它。
如果我把那个g-string:
${grailsApplication.config.grails.tomcatURL}${createLinkTo(controller: 'mandant', action: 'logo_image', id: mandant.id)}
没有gsp中的<img-tag>
,并在该超链接上点击,gsp调用控制器,图像显示在新的浏览器选项卡中。
我希望任何人都能理解我的问题
格尔茨
Max Jando
答案 0 :(得分:0)
如果您使用base
属性(以及createLink
tag),它是否有效:
${createLink(controller: 'mandant', action: 'logo_image', id: mandant.id, base:grailsApplication.config.grails.tomcatURL)}