指定视图的模型属性

时间:2016-07-17 10:21:51

标签: java spring spring-mvc thymeleaf

我使用Spring Boot MVCThymeleaf作为视图图层。 我已经指定了headeralertfooter等片段。我想基于我的映射创建动态导航。

是否可以创建设置为指定视图的模型?仅在指定视图中指定模型会更清晰

编辑:

假设我的index.html中有类似的内容。

<div th:replace="fragments/header :: header">Test</div><h1>HelloWorld</h1> 我希望只能在header片段文件中访问我的模型,而不能在index.html中访问。

0 个答案:

没有答案
相关问题