Reputation: 3660
Is it possible to pass the value of a taglib as a string to an element instead of rendering to out?
Have this special use case where part of the GSP's HTML is produced by an XSL Transformation, and inside the produced HTML have to find a specific DIV and populate it with content of a TAGLib.
Upvotes: 0
Views: 156
Reputation: 23323
You can call taglibs from controllers and then assign return value to variable:
def value = g.render(template: '/my-template', model: [message: 'hello world'])
println value
Technically you call taglib from any bean (and even any static method using Holders
) but this is treated as bad practice
Upvotes: 2