jQuery in Action, 3rd edition
The moose likes JSP and the fly likes Dropdownlist value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Dropdownlist value" Watch "Dropdownlist value" New topic

Dropdownlist value

sumit sharmast

Joined: Jul 29, 2012
Posts: 15
Dear All,

How can I send the value of quantity(droplist list) of below JSP to servlet(displayCart), please correct.

sonu raj
Ranch Hand

Joined: Jul 31, 2012
Posts: 43

This may help. The edited part is highlighted

<jsp:include page="/header.html" />

<td width="570" valign="top" colspan="2">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<form action="displayCart" method="get">
<table cellpadding="5" border="0">
<tr valign="bottom">
<th align="left">Description</th>
<th align="left">Price</th>
<th align="left">Quantity</th>
<th align="left"> </th>

<c:forEach var="product" items="${products}">
<tr valign="top">




<td><select name="quantity">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4 </option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8 </option>
<option value="9">9</option>
<option value="10">10</option>


<td width="179">
<img src="${product.imageURL}" width="175" height="175">

<a href="
<c:url value='/cart/displayCart?productCode=${product.code}'/>">
<input type="submit" value="Add to cart" >

I agree. Here's the link: http://aspose.com/file-tools
subject: Dropdownlist value
It's not a secret anymore!