Hi All,
I have a jsp which iterates through shop offers and presents them in a
table on the page.
Therefore I have a number of parameters named offerId, and an equal
number of parameters named
quantity. When the form is submitted I want the 'quantity' ordered to
match up with the 'offerId'.
The following code seems to show that they do match up:
String[] offers = request.getParameterValues("offerId");
String[] quantity = request.getParameterValues("quantity");
for(int i=0; i < offers.length; i++)
System.out.println("OfferId: " + offers[i] + " | " + "Quantity: "
+ quantity[i]);
I just want too make sure though, in the above situation am I guaranteed
that the 2 will match up?
I don't want to end up with a situation where accidently the wrong item
is ordered or the wrong quantity? Is there a better way to do this?
Thanks
Joel
==========================================================================To
unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets