我使用的是Spring。我有一个带有表单的JSP :select in it,显示用户列表。在这种情况下,用户名或id对用户来说意义不大,所以我需要显示名字和姓氏。
我试过了:
<form:select id="userSelect" name="userId" path="user.id">
<option value="">Select to Edit</option>
<form:options items="${user.userList}" itemValue="id" itemLabel="lastname firstname" />
</form:select>
但这给了我一个很大的错误。怎样才能让itemLabels显示姓氏、名字?
https://stackoverflow.com/questions/7143738
复制相似问题