使用 Spring MVC 时是否有真正的 JSP 标签替代品?
我正在使用 Spring MVC 将其集成到 JS 框架中。我在 Spring MVC 中缺少的是一种模板框架
我以前使用过带有 JSF2 的 Facelets 模板,我喜欢它。
是否有与 Spring MVC 很好地集成并提供与 Facelets 类似的功能的框架/技术?
- 没有(或很少)xml 配置
- 可以在一个模板文件中定义部分,并从一个文件中填充所有部分的所有供应内容
我正在查看 Apache Tiles 文档,看来您需要为模板中的每个部分提供单独的文件。
示例(伪代码):
模板.html:
<insert:headerSection>
<insert:bodySection>
使用-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 是我最好的选择,我在这个线程中找到了一些建议