在 Spring MVC 中重用模板页面
以下最好和最简单的技术是什么?
瓷砖、速度还是自由创造者?
谢谢。
What is the best and easiest technology from the followings?
Tiles, velocity or freemaker?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有“最好”,但很高兴知道 JSP 作为一种视图技术已经提供了
标记。例如,您可以在其中编写
menu.jsp
,就好像它是父页面的一部分一样:有两种“标准”替代方案:
@include
指令和 JSTL
标记。不同之处在于在运行时期间包含该页面(这实际上具有可以包含其他动态内容的好处)。
@include
指令在编译时期间包含页面(因此只会发生一次),而
的进一步区别在于它包含页面生成的输出,因此不包含源代码,因为两者都 < code>@include
可以。然而,
的主要好处是您可以通过这种方式包含外部资源。例如There's no "best", but it's good to know that JSP as being a view technology already provides the
<jsp:include>
tag for this. E.g.where in you can just code
menu.jsp
as if it's a part of the parent page:There are two "standard" alternatives: the
@include
directive and the JSTL<c:import>
tag.The difference is that the
@include
directive includes the page during compile time (thus it will happen only once), while the<jsp:include>
includes the page during runtime (which has actually the benefit that you can include another dynamic content).Further is the difference of
<c:import>
that it includes the generated output of the page and thus not the source code as both<jsp:include>
and@include
does. The major benefit of<c:import>
is however that you can include external resources this way. E.g.