Skip to content

Jade engine in RC7 problem with resolving template files #446

@marcinc81

Description

@marcinc81

Hi, first of all: thank you for the effort and this awesome framework - I hope I will stay with it a bit longer, looks promising!

Today I was struggling with Jade templates because I was getting HTTP 500 error and blank page. Internally it was just null pointer exception when Jade4J was trying to load file using ClasspathTemplateLoader. It couldn't load template file because was outside the "scope" (I think it was the reason). Adding relative or absolute path to template file didn't give any good results. I decided to try other template loaders, so I replaced org.jooby.jade with copied implementation using FileTemplateLoader - and success! Even when template file can't be loaded Jooby sends pretty error message not a blank page.

I think this loader should be replaced - or maybe explained in the Doc how to use it correctly. I must admit that I have no idea how to load jade template using ClasspathTemplateLoader. Also now, when I use FileTemplateLoader I have problem with finding proper templates path - it's relative to target/classes/ - in dev env, in production it can be different path - but I may be wrong here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions