【发布时间】:2016-05-19 08:12:49
【问题描述】:
让我们有两个表单支持类。
Person
- name (String)
- surname (String)
Application
- reason (String)
- date (Date)
- person (Person)
还有一个 Thymeleaf 片段,它为 Person 对象呈现 html 表单,如下所示:
<input name="name"/>
<input name="surname"/>
是否有可能在片段中重用相同的片段,以预期结果呈现Application html 表单:
<input name="reason"/>
<input name="date"/>
<input name="person.name"/>
<input name="person.surname"/>
换句话说,在Person是顶级表单支持bean的情况下以及在它是其他表单支持bean的一部分的情况下,Thymeleaf表单片段可以通用吗?
【问题讨论】:
标签: java spring-mvc thymeleaf