partial mapping error

63 views
Skip to first unread message

Gordon Wilkinson

unread,
Mar 2, 2016, 6:15:45 PM3/2/16
to handlebars.java
I am calling classpath:/handlebars/partials/mainCss.hbs from classpath:/handlebars/index.hbs as {{> mainCSS}}

I get a client error:
This application has no explicit mapping for /error, so you are seeing this as a fallback.

There was an unexpected error (type=Internal Server Error, status=500).
classpath:/handlebars/index.hbs:17:8: The partial 'classpath:/handlebars/mainCSS.hbs' could not be found

How do I add the nested partials?

Thanks,

Gordon

edgar

unread,
Mar 3, 2016, 9:14:48 AM3/3/16
to handlebars.java

You can try: {{> partials/mainCSS}}

But it depends on how did you create the HandlebarsViewResolver and if you set a prefix or not.

Gordon Wilkinson

unread,
Mar 3, 2016, 11:56:09 AM3/3/16
to handlebars.java
Thanks for this. 

Here is my viewResolver instance and prefix:

    HandlebarsViewResolver resolver = new HandlebarsViewResolver();
    resolver.setPrefix("classpath:/handlebars/");

 {{> partials/mainCSS}} does work however I am looking to configuration to handle paths. 

edgar

unread,
Mar 3, 2016, 12:24:27 PM3/3/16
to handlebars.java
Hi,

 Sorry, but don't follow. What do you mean by "configuration to handle paths"?

Gordon Wilkinson

unread,
Mar 3, 2016, 1:28:41 PM3/3/16
to handlebars.java
My bad.  I meant configuring the location of partial folders. 

edgar

unread,
Mar 3, 2016, 1:33:12 PM3/3/16
to handlebars.java
No problem! and thanks for trying handlebars.java

Also, I invite you to try http://jooby.org a micro and lightweight micro framework (lot simpler and easy to use compared to Spring ;)
Reply all
Reply to author
Forward
0 new messages