Thymeleaf Templates - Documentation Correct?

39 views
Skip to first unread message

ty...@foreflight.com

unread,
Jun 14, 2017, 1:18:44 AM6/14/17
to Baratine
I'm interested in getting Thymeleaf templates working in Baratine. I followed the documentation at http://doc.baratine.io/v1.0/tutorials/views/, which notes the following:

public class MyService
{
@Get("/hello")
public void hello(RequestWeb req)
{
ViewAndMapBuilder map = Views.view("hello.html");
map.add("name", "John");

req.ok(map);
}

public static void main(String[ ]args)
{
scanAutoConf();
include(MyService.class);

Web.property("view.thymeleaf.templates", "classpath:/");

start();
}
}

Setting aside that the calls for e.g. scanAutoConf() are no longer valid (Web.scanAutoConf()) is, is the Web.property key correct? I've tried "classpath:/", "classpath:/templates", "classpath:/public", and Baratine is unable to locate the templates.

I did get Freemarker to work.

Looking into Spring / Reactive Spring. The inaccuracy of Baratine documentation is frustrating.

-tyson
--
This email message is for the sole use of the intended recipient and may
contain confidential and privileged information. Any unauthorized review,
use, disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message.

ty...@foreflight.com

unread,
Jan 4, 2018, 10:04:52 PM1/4/18
to Baratine
Answer:

Web.property("view.thymeleaf.templates", "classpath://templates/");

With this dependency:

<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf</artifactId>
<version>2.1.4.RELEASE</version>
</dependency>
Reply all
Reply to author
Forward
0 new messages