Using custom tags in template loaded from String via TemplateLoader fails

Bug #554762 reported by Łukasz Walkow on 2010-04-03
This bug affects 2 people
Affects Status Importance Assigned to Milestone
play framework
Nicolas Leroux

Bug Description

Using custom tags in template loaded from String:

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

generates error:

Internal Server Error (500) for request GET /entities

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

        at play.mvc.ActionInvoker.invoke(
        at Invocation.HTTP Request(Play!)
Caused by: java.lang.NullPointerException
        at play.templates.Template.cleanStackTrace(
        at play.templates.Template.render(
        at play.mvc.results.RenderTemplate.<init>(
        at play.mvc.Controller.renderTemplate(
        at controllers.Application.createEntities(
        at play.utils.Java.invokeStatic(
        at play.mvc.ActionInvoker.invoke(
        ... 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  Edit
Everyone can see this information.

Other bug subscribers