You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This, however does not work due to the fact that Utils#pathOffset assumes templates to reside in a nested route (and produces a wrong template location because of that).
Steps to reproduce
Reproduce with the following test case:
@TestpublicvoidtestTemplateHandlerSingleRoute() throwsException {
TemplateEngineengine = newTestEngine(false);
router.route("/test-template")
.handler(context -> {
context.put("foo", "badger");
context.put("bar", "fox");
context.next();
})
.handler(TemplateHandler.create(engine, "somedir", "text/html"));
// we assume test-template is going to be// mapped to {somedir}/test-template.html and// rendered correctly with pre-setup context variablesStringexpected =
"<html>\n" +
"<body>\n" +
"<h1>Test template</h1>\n" +
"foo is badger bar is fox<br>\n" +
"</body>\n" +
"</html>";
testRequest(HttpMethod.GET, "/test-template", 200, "OK", expected);
}
The text was updated successfully, but these errors were encountered:
Version
Context
I'd like to use the
TemplateHandler
for selected, single routes like that:This, however does not work due to the fact that
Utils#pathOffset
assumes templates to reside in a nested route (and produces a wrong template location because of that).Steps to reproduce
Reproduce with the following test case:
The text was updated successfully, but these errors were encountered: