Java 使用相同的struts html:optionCollection for difference下拉列表

Java 使用相同的struts html:optionCollection for difference下拉列表,java,struts,Java,Struts,我使用的是struts 1.1,我有两个下拉列表,它们具有相同的数据(下拉列表)。我必须将所选的两个值作为varchar保存在两个不同的列中。 我是否可以使用在表单中为两个下拉列表创建的相同地图来完成此操作 例如,下面是一个保存用户id的下拉列表,假设还有另一个类似的下拉列表,我保存的创建用户id都使用相同的填充用户列表 <html:select property="selectedCancelUserId"> <html:option value="">-&l

我使用的是struts 1.1,我有两个下拉列表,它们具有相同的数据(下拉列表)。我必须将所选的两个值作为varchar保存在两个不同的列中。
我是否可以使用在表单中为两个下拉列表创建的相同地图来完成此操作

例如,下面是一个保存用户id的下拉列表,假设还有另一个类似的下拉列表,我保存的创建用户id都使用相同的填充用户列表

<html:select property="selectedCancelUserId">
     <html:option value="">-</html:option>
     <html:optionsCollection property="usedByUserList" label="name" value="staffNo"/>
</html:select>

-

您需要在表单中包含两个不同的表单变量,如
selectedCancelUserId
selectedCreateUserId
,以捕获来自用户的两个不同输入。只要与表单值关联,就可以在表单中多次使用
usedByUserList
进行显示

 <html:select property="selectedCancelUserId">
       <html:option value="">-</html:option>
       <html:optionsCollection property="usedByUserList" label="name" value="staffNo"/>
 </html:select>

 <html:select property="selectedCreateUserId">
       <html:option value="">-</html:option>
       <html:optionsCollection property="usedByUserList" label="name" value="staffNo"/>
 </html:select>

-
-