PDA

View Full Version : Please help me!!! Urgently!!!



huisoonsg
06-30-2005, 03:17 PM
Hi to all, Can anyone that know what the following codes mean pls reply. Thanks a lot.<!-- Instantiate the Counter bean with an id of "counter" -->
<jsp:useBean id="cart" scope="session" class="database.ShoppingCart" />
<%
String id = request.getParameter("itemID");
String buttonPressed = request.getParameter("Submit");
String updatePressed = request.getParameter("input");
String quantity = request.getParameter("Sum");

if(id!=null){
if (updatePressed!=null){
cart.updateQuantity(id, Integer.parseInt(quantity));
}

if (buttonPressed!=null){

cart.removeItem(id);
}
}

%>

jscheuer1
06-30-2005, 07:43 PM
Check to see if either of two conditions is true, if one of them is, do one thing, if the other is, do something else. The details of these conditions and actions are defined elsewhere but, hinted at by the variable, string variable and function names involved. To wit, the updating of the quantity of or removal of an item from the shopping cart based upon wether or not a particular button has been pressed. In the case of the item quantity, it is also based upon (most likely) a user supplied value. Of course, if these names are inappropriate to their actual uses, it could be just about anything.