Using custom tags in template loaded from String via TemplateLoader fails

Bug #554762 reported by Łukasz Walkow
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
play framework
Confirmed
Undecided
Nicolas Leroux

Bug Description

Using custom tags in template loaded from String:

        String code = "#{notification/}";
        Template templatePlay = TemplateLoader.load("myTemplate", code);
        renderTemplate(templatePlay.name, renderArgs);

generates error:

@6243j13i5
Internal Server Error (500) for request GET /entities

Java exception (In /app/controllers/Application.java around line 67)
NullPointerException occured : null

play.exceptions.JavaExecutionException
        at play.mvc.ActionInvoker.invoke(ActionInvoker.java:229)
        at Invocation.HTTP Request(Play!)
Caused by: java.lang.NullPointerException
        at play.templates.Template.cleanStackTrace(Template.java:313)
        at play.templates.Template.render(Template.java:247)
        at play.mvc.results.RenderTemplate.<init>(RenderTemplate.java:22)
        at play.mvc.Controller.renderTemplate(Controller.java:429)
        at controllers.Application.createEntities(Application.java:67)
        at play.utils.Java.invokeStatic(Java.java:129)
        at play.mvc.ActionInvoker.invoke(ActionInvoker.java:138)
        ... 1 more

When i use render() method with the same code placed in HTML file everything works fine.
It could be nice to have good error reporting when working with template from String. By now it's just nullpointer Exception for most problems, without any description.

Changed in play:
milestone: none → 1.1
assignee: nobody → Nicolas Leroux (nicolas-lunatech)
status: New → Confirmed
Changed in play:
milestone: 1.1 → none
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.