request.getParameter始终为null

时间:2016-02-25 11:33:00

标签: jsp

null

但这是获取$ ls build/tmp/sysroots raspberrypi raspberrypi-tcbootstrap x86_64-linux $ ls x86_64-linux/ bin etc lib sbin usr var $ find -name sysroots ./build/tmp/work/armv6-vfp-poky-linux-gnueabi/binutils-cross/.../sysroots ... ./build/tmp/work/x86_64-linux/m4-native/.../sysroots ./build/tmp/work/x86_64-linux/gnu-config-native/.../tmp/sysroots ... ./build/tmp/work/x86_64-linux/sqlite3-native/.../sysroots ... ./build/tmp/work/x86_64-linux/openssl-native/.../sysroots ... 而不是选项值。

1 个答案:

答案 0 :(得分:0)

请参阅Demo

的Javascript,

<script>  
    window.displayValue = function() { 
         var e = document.getElementById("Nsem");
         var selVal = e.options[e.selectedIndex].value; 
         var span = document.getElementById("selectedValue");
         span.innerHTML = selVal;   //This will add value like 1/2/3
    }
</script>

在您的HTML中添加范围标记

<select name="Nsem" id = "Nsem" onchange="disp();">
   <option value="1">First</option>
   <option value="2" selected>Second</option>
   <option value="3">Third</option>
</select>
<span id="selectedValue"></span>

希望这有帮助。