Reputation: 955
I'm trying to use the @include_page
macro from FreemarkerServlet - using Maven Freemarker framework with Freemarker version 2.3.31 and I can see the notes about this tag being now available in the source of it, but it still is not resolved/recognized in the actual template output.
For context:
@include_page
allows to include jsp pages into ftl<h2>Hello!</h1>
<#assign....>
.
.
.
<div>
<@include_page path="hello.jsp"/>
</div>
.
.
.
if
sDoes anyone know if there is some additional configuration needed to make use of it?
Upvotes: 0
Views: 209
Reputation: 955
The issue was that we needed to add the
model.put( FreemarkerServlet.KEY_INCLUDE, new IncludePage( request,
response ) );
to the FreemarkerView model.
This is the post that actually solves the problem.
Upvotes: 1
Reputation: 31152
To use JSP support (and include_page
is part of it) you have to invoke the template with forwarding to an URL that's mapped to the FreemarkerServlet
, instead of directly calling FreeMarker with its Java API. It's just how JSP works too (or have worked, originally). See https://freemarker.apache.org/docs/pgui_misc_servlet.html for details.
Upvotes: 0