Hello Alpha Geeks
I put a small grails plugin out today.
http://www.grails.org/plugin/grails-template-engine
The plugin simply exposes the GSP render engine as a service for backend GSP template rendering . It also adds a new convenient method to the controllers called renderWithTemplateEngine
The implementation was mostly lifed from Graeme's mail plugin. Now it is available standalone.
Hopefully this is useful to someone out there :)
3 comments:
Peter, This is exactly what i was looking for, but when i try to run i was getting a compile error:
[groovyc] C:\Users\mlathe\Documents\IntelliJProjects\--snip--\MailService.groovy: 3: unable to resolve class GrailsTemplateEngineService
[groovyc] @ line 3, column 1.
[groovyc] import GrailsTemplateEngineService
[groovyc] ^
[groovyc]
[groovyc] 1 error
If i move your class to the "templateEngine" package and do an "import templateEngine.GrailsTemplateEngineService" then the import works, but i get a nullpointer error (i guess the dependency is not injected)?
Also i noticed that the API is actually "protected renderView()" not "renderWithTemplateEngine" as it is in the documentation. It's also protected which seems wrong right?
Any ideas?
Does this still work in 1.3.6? The rendering methods on GrailsTemplateEngineService have "protected" access. Is it sill possible to use this service from within another service? If so, how is it done?
Um, if this plugin isn't being managed, it should be removed. I can't get it to work, and the documentation on grail's site is not helpful.
Grails doesn't even recognize the class when I use it as documented.
Post a Comment