开发者

getting value from drop down list in JSP

开发者 https://www.devze.com 2023-01-27 16:48 出处:网络
How can I get a value of a drop开发者_Python百科 down list in JSP and store it through session? HTML

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

精彩评论

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