java – Spring百里叶的页眉和页脚动态包括
我最近在春天开始使用百里香模板引擎.我想要实现的是 – 如果我的控制器就是这个
然后我想在homePage.html中编写HTML代码而没有像head,title,body等完整的HTML定义.
|
我最近在春天开始使用百里香模板引擎.我想要实现的是 – 如果我的控制器就是这个
然后我想在homePage.html中编写HTML代码而没有像head,title,body等完整的HTML定义.
|
注意:我已经看过这些例子了
> http://www.thymeleaf.org/doc/articles/layouts.html
> https://looksok.wordpress.com/2014/06/28/spring-website-layouts-ssi-with-thymeleaf-templates/
> http://blog.codeleak.pl/2013/11/thymeleaf-template-layouts-in-spring.html
Controller指向index.html并给出“内容页面”的属性
@RequestMapping(value={"/"})
public String root(Locale locale,ModelMap model) {
model.addAttribute("content","helloWorldView");
return "index";
}
这是我的index.html:
所以我有一个带页眉和页脚的文件夹片段:
片段/了header.html
片段/ footer.html
在我的文件夹视图中,我获得了包含内容的所有视图
意见/ helloWorldView.html:
(编辑:李大同)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!