thymeleaf drop-down box to select Echo

Reference a lot, finally achieved in this way. Although some stupid, initial learning phase. 
I do not know why use th: field error. Some are using the Internet to solve the field echo problem.

<SELECT name = "position" Lay-Verify = "required">
<TH Option: Selected = "$ {aet.getPosition () == 'TA'}" th: value = "TA"> TA </ Option>
< option th: selected = "$ { aet.getPosition () == ' lecturer'}" th: value = "instructor"> instructor </ Option>
<option th: selected = "$ { aet.getPosition () == ' Associate Professor '} "th: value =" Associate Professor "> Associate Professor </ option>
<TH Option: Selected =" $ {aet.getPosition () ==' Professor '} "th: value =" professor "> Professor </ option >
</ SELECT>

Guess you like

Origin www.cnblogs.com/christy99cc/p/12032763.html