Velocity 中 Thymeleaf 片段的等价物
Equivalent of Thymeleaf fragments in Velocity
我经常使用 th:fragment,但目前我正在使用 Apache Velocity,我想知道是否有任何等效项。不幸的是 Google 无法进一步帮助我。您知道任何技巧或解决方法吗?
我能想到的最接近的事情是包括其他寺庙文件:
<html>
<head>
<title>Homepage</title>
</head>
<body>
<h1>Welcome!!</h1>
#include("./src/pageFooter.vm")
</body>
</html>
或使用Macros
#macro( tablerows $color $values )
#foreach( $value in $values )
<tr><td bgcolor=$color>$value</td></tr>
#end
#end
我经常使用 th:fragment,但目前我正在使用 Apache Velocity,我想知道是否有任何等效项。不幸的是 Google 无法进一步帮助我。您知道任何技巧或解决方法吗?
我能想到的最接近的事情是包括其他寺庙文件:
<html>
<head>
<title>Homepage</title>
</head>
<body>
<h1>Welcome!!</h1>
#include("./src/pageFooter.vm")
</body>
</html>
或使用Macros
#macro( tablerows $color $values )
#foreach( $value in $values )
<tr><td bgcolor=$color>$value</td></tr>
#end
#end