Skip to content

Instantly share code, notes, and snippets.

@krams915
Created December 12, 2012 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krams915/4268161 to your computer and use it in GitHub Desktop.
Save krams915/4268161 to your computer and use it in GitHub Desktop.
Spring Thymeleaf users.html snippet
<form action="#" th:action="@{/users/create}" th:object="${commanduser}" method="post">
....
<tr>
<td><input type="text" hidden="hidden" th:field="*{id}"/>
<input type="text" th:field="*{firstName}"/></td>
<td><input type="text" th:field="*{lastName}"/></td>
<td><input type="text" th:field="*{username}"/></td>
<td><select th:field="*{role}">
<option th:each="role : ${allRoles}" th:value="${role}"
th:text="#{${'user.role.' + role}}">Access Type 1</option>
<option th:remove="all" value="2">Access Type 2</option>
</select></td>
</tr>
....
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment