简体   繁体   English

Spark-java 2.5&Pebble-始终内部服务器错误

[英]Spark-java 2.5 & Pebble - always Internal Server Error

When I follow the tutorial for using Pebble with Spark-Java framework 2.5, I just get an Internal Server Error with no stack crawl. 当我遵循将Pebble与Spark-Java Framework 2.5结合使用的教程时,我仅收到内部服务器错误,而没有堆栈爬网。

I can get Freemarker working, and Velocity as well - but not Pebble which is of course the one I want to use. 我可以使Freemarker正常工作,也可以使Velocity正常工作-但Pebble不能工作,这当然是我要使用的工具。

I tried joining the google group for spark java two days ago and still waiting for admission which seems a tad slow tbh. 两天前,我尝试加入Google小组参加Spark Java,但仍在等待入场,这似乎有点慢。

I've tried placing the template in resources, resources/public, resources/public/spark - nothing seems to work. 我尝试将模板放在资源,资源/公共,资源/公共/火花中-似乎没有任何作用。

Has anyone managed to make this work? 有没有人设法做到这一点?

If you're using the default DelegatingLoader for PebbleEngine, it sounds like you're not passing a valid path to ModelAndView. 如果您对PebbleEngine使用默认的DelegatingLoader,听起来您没有将有效路径传递给ModelAndView。 If you place your template in your root directory, and pass the path "./my-template.pebble" to the ModelAndView constructor, it should work. 如果将模板放置在根目录中,并将路径“ ./my-template.pebble”传递给ModelAndView构造函数,则它应该可以工作。

Edit: I've merged an update for the example spark-template-pebble project, you can view it here . 编辑:我已经合并了示例spark-template-pebble项目的更新,您可以在此处查看

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM