- Integer qty = new Integer(web.parsed[1]);
- Integer price = new Integer(web.parsed[2]);
- inventorylist.buyitem(web.parsed[0], qty.intValue(), price.intValue());
+ System.printString("DEBUG > Calling buy transaction\n");
+ Integer qty = new Integer(web.parsed[2]);
+ Integer price = new Integer(web.parsed[3]);
+ int ret = inventorylist.buyitem(web.parsed[1], qty.intValue(), price.intValue());
+ if (ret == 0) {
+ web.httpresponse();
+ StringBuffer s = new StringBuffer("Bought item ");
+ s.append(web.parsed[1]);
+ s.append(" Quantity ");
+ s.append(web.parsed[2]);
+ s.append(" Price ");
+ s.append(web.parsed[3]);
+ s.append("<br />");
+ String towrite = new String(s);
+ web.write(towrite.getBytes());
+ } else {
+ web.httpresponse();
+ String s = new String("Error encountered");
+ web.write(s.getBytes());
+ }