【发布时间】:2013-01-30 03:26:06
【问题描述】:
在使用 Spring MVC 时是否有真正的 JSP 标签替代方案?
我正在使用 Spring MVC 将其集成到 JS 框架中。 我在 Spring MVC 中缺少的是一种 模板框架
我以前使用过带有 JSF2 的 Facelets 模板,我喜欢它。
是否有与 Spring MVC 很好地集成并提供与 Facelets 类似的功能的框架/技术?
- 没有(或很少)xml 配置
- 可以在一个模板文件中定义部分,并从一个文件中填充所有部分的所有供应内容
我正在查看 Apache Tiles 文档,看来您需要为模板中的每个部分设置单独的文件。
示例(伪代码):
template.html:
<insert:headerSection>
<insert:bodySection>
using-template.html:
<use-template: template.html>
<define:headerSection>this is a header</define:headerSection>
<define:bodySection>this is a body</define:bodySection>
我知道我可以使用 JSP 实现这一点,但使用 Facelets 编写代码看起来更简洁、更快捷。
如果 JSP 是我的最佳选择,我在 this thread 中找到了一些建议
【问题讨论】:
标签: java jsp templates spring-mvc facelets