java - How does freemarker achieve this simple effect?
我想大声告诉你
我想大声告诉你 2017-05-27 17:41:00
0
2
485

template

<!DOCTYPE html>
<html>
<head>
<#include "baseHeader.html" />
<#macro head ><#nested></#macro>
<#macro style ><#nested></#macro>
</head>

<body>
<#macro content >
    <#nested>
</#macro>
</body>

<#macro script >
    <#nested>
</#macro>
</html>

Page call

<#include "/layout/master.ftl" />
<@script>var a=1;</@script>

In the page generated as a result, the sentence var a=1; ran behind </html>, that is, at the end of the template, and did not appear in the corresponding part of the template. Location.

I have been doing it for several years.net, and I feel that it is natural for this kind of template to produce the effect I have.
But on java, it seems that it is not easy to achieve the effect I expected?

我想大声告诉你
我想大声告诉你

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!