Home Grails 3.2.8 - Taglib ˜g not acessible from controller
Reply: 1

Grails 3.2.8 - Taglib ˜g not acessible from controller

Leonardo
1#
Leonardo Published in 2017-11-06 14:13:02Z

Im trying to use the following command on a controller:

String html = g.render(template: 'etiqueta', model: [user: user])

It works perfectly on another project of mine, using Grails 3.3.1. But on Grails 3.2.8 it doens't work! I'm trying to find a workaround without success.

I just started on a new job and I got stuck on this task because of this issue, it`s been a couple days now...

Does anyone know to solve this?

Jeff Scott Brown
2#
Jeff Scott Brown Reply to 2017-11-06 14:29:23Z

You can use a PageRenderer.

class SomeController {

    PageRenderer groovyPageRenderer

    def someAction() {
        def html = groovyPageRenderer.render(template: 'etiqueta', model: [user: user])
        // ...
    }
}
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.292933 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO