是否有可能与thymeleaf检索输入“生成”的名称属性?thymeleaf如何获得输入支持bean生成的名称属性
我需要创建一个id等于输入名称属性的div。 输入名称通过th:字段生成。
标记:
<input type="radio" id="winterTiresInstalled" th:field="*{winterTiresInstalled.value}" />
生成的标记:
<input id="fld_winterTires" type="radio" name="vehicle.winterTiresInstalled.value" />
我想要什么:
<div th:id="???" />
获得:
<div id="vehicle.winterTiresInstalled.value" />
所以,我怎么能检索生成的名称属性值 “vehicle.winterTiresInstalled.value” 与thymleaf?
我可以在js中完成,但我更愿意在我的模板中完成它。
谢谢。 David
name属性似乎是由类SpringInputRadioFieldAttrProcessor.doProcess方法(String name = bindStatus.getExpression();)生成的。我们如何检索百里香的spring-mvc bindStatus? – user2069716
使用thymeleaf 2.1.4.RELEASE和spring-mvc 4.3.3.RELEASE – user2069716