开发者

getting value from drop down list in JSP

How can I get a value of a drop开发者_Python百科 down list in JSP and store it through session?


HTML

Note: note here name attribute of combobox is specified

   <select name="comboOne" >
      <option>Small0</option>
      <option>Small1</option>
      <option>Small2</option>
   </select>
   <input type="submit"/>

</form>  

JSP / SERVLET

request.getParameter("comboOne");//this will return selected value  

I would suggest to go for JSTL approch.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜