1、后台代码
@RequestMapping("/enterPriseBusiness/add")
public String addEntBusinessInfo(Model model) {
model.addAttribute("title", "企业中文名: ");
model.addAttribute("tclass","col-xs-2 required");
model.addAttribute("tstyle","text-align:right;background:blue;font:italic bold 12px/20px arial,sans-serif;")
return PREFIX + "business/enterPriseBusinessAdd";
}
2、thymeleaf取值
<label for="enterpriseCN" th:class="${tclass}" th:style="${tstyle}" th:utext="${title}"></label>