Java 如何从html:options集合中获取所选选项值

Java 如何从html:options集合中获取所选选项值,java,javascript,jsp,struts,jsp-tags,Java,Javascript,Jsp,Struts,Jsp Tags,我的JSP中有一个下拉列表。如何从JSP中的标记中获取所选值 将标签更改为 <html:select property="temp_Id" styleId = "tempId" > html:options collection="listmap" property="key"/> </html:select> 应该可以。谢谢。我希望scriptAttribute id中的选定值对于根据TLDThanks ArunM选择的标记无效。如何从HashMap获取所

我的JSP中有一个下拉列表。如何从JSP中的
标记中获取所选值


将标签更改为

<html:select property="temp_Id" styleId = "tempId" >
html:options collection="listmap" property="key"/>  
</html:select>

应该可以。谢谢。

我希望scriptAttribute id中的选定值对于根据TLDThanks ArunM选择的标记无效。如何从HashMap获取所选键的值javascript将仅从HashMap获取键。不确定您要查找的内容。我想遍历Hashmap,并希望所选键的值听起来很奇怪。。你为什么要这么做?如果您希望将该值显示为选项的标签,请尝试以下操作
var e = document.getElementById("tempId");
var strUser = e.options[e.selectedIndex].value;