R
ros
Hi,
I am not very experienced in servlets and am working on making a
simple shopping cart. This application has 3 servlets and one of these
servlets (ReviewShoppingCart) has a form which has 2 submit buttons.
One button should point to AddToShoppingCart servlet and the other
should point to RemoveFromCart.
But I don't really know how to have the if/else code for that. I mean
I tried the code and it is pasted below.
String actionString = request.getParameter("Submit");
if (actionString.equals("Add More Items")) {
System.out.println("addToShoppingCart");
AddToShoppingCart(request, aPW);
}else if (actionString.equals("Remove From Basket")) {
RemoveItemsFromCart(request, aPW);
System.out.println("reviewShoppingCart");
}
Please help me with this. I would be extremely grateful.
ros
I am not very experienced in servlets and am working on making a
simple shopping cart. This application has 3 servlets and one of these
servlets (ReviewShoppingCart) has a form which has 2 submit buttons.
One button should point to AddToShoppingCart servlet and the other
should point to RemoveFromCart.
But I don't really know how to have the if/else code for that. I mean
I tried the code and it is pasted below.
String actionString = request.getParameter("Submit");
if (actionString.equals("Add More Items")) {
System.out.println("addToShoppingCart");
AddToShoppingCart(request, aPW);
}else if (actionString.equals("Remove From Basket")) {
RemoveItemsFromCart(request, aPW);
System.out.println("reviewShoppingCart");
}
Please help me with this. I would be extremely grateful.
ros