-
-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jade engine in RC7 problem with resolving template files #446
Comments
Hi, Sorry you wasted time debugging Jade... something to keep in mind in Jooby is that we usually do configuration/bootstrap of libraries and usually don't wrap, extends or modify external libraries (unless it is absolutely necessary). What does it means? This sounds like a bug in Jade and their About, template engine in general:
Think all you need to do is to save your templates inside {
use(new Jade(".jade"));
get("/", () -> Results.html("index"));
}
Let me know if you have questions and again if you can reproduce the |
Thanks for reply! It's not time wasting btw, it's a pure pleasure. :) Answering your questions: Jooby couldn't render error page due to the same reason - null pointer exception. 1st time exception was thrown due to try loading page template, 2nd time due to loading error template. Both failed (hard).
Blank page is displayed when there's some error, such as 404. Look at this stack trace:
Indeed, keeping templates in public folder worked! I added 'err.jade' in /public and now I can see my error page, but without this file: blank page and that stack trace. Cheers! |
Ok, so you found a bug here with Jade! Will fix it! If you like jooby don't forget to add a star!!! Thanks |
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 usingClasspathTemplateLoader
. 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 replacedorg.jooby.jade
with copied implementation usingFileTemplateLoader
- 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 useFileTemplateLoader
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.The text was updated successfully, but these errors were encountered: