mbknor/faster-groovy-templates — Issue #13: Closure in tag call makes compiler think it's the end of the tag
Author: tazmaniax
Created: 2012-02-29 12:57:42+00:00
State: open

Hi Morten,

I have tag call where I'm trying to pass in a closure. It looks like this is confusing the compiler which thinks it's the end of the tag but not properly closed. There's no nested exception so not easy to pinpoint the source of the error. I guess the compiler needs to ignore curly braces contained within quotes. Thoughts?

#{tzselect field.name, items:models.Feedback.Type.values(), valueProperty:'name', labelProperty:'name', value:params[field.name] != null ? params[field.name]?.escape()?.raw() : field.value?.escape()?.raw(), labelMap:'{ it -> play.i18n.Messages.get("feedback.type." + it) }', class:'test', id:field.id /}

Template compilation error (In /app/views/uis/Feedback.html around line 31)
The template /app/views/uis/Feedback.html does not compile : Found unclosed tag #{tzselect}

play.exceptions.TemplateCompilationException: Found unclosed tag #{tzselect}
at play.modules.gtengineplugin.GTTemplate.renderGTTemplate(GTTemplate.java:106)
at play.modules.gtengineplugin.GTTemplate.internalGTRender(GTTemplate.java:75)
at play.modules.gtengineplugin.GTTemplate.internalRender(GTTemplate.java:54)
at play.modules.gtengineplugin.GTTemplate.render(GTTemplate.java:128)
at play.mvc.results.RenderTemplate.(RenderTemplate.java:24)
at play.mvc.Controller.renderTemplate(Controller.java:660)
at play.mvc.Controller.renderTemplate(Controller.java:640)
at play.mvc.Controller.render(Controller.java:695)
at controllers.tzSecure.Secure.login(Secure.java:62)
at play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:548)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:502)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:478)
at play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:473)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:161)
at Invocation.HTTP Request(Play!)

cheers,
Chris