0
try {

           HttpSession hs = request.getSession();
           HashMap<String,Item> items = (HashMap<String, Item>) hs.getAttribute("items");

           String [] allQty = request.getParameterValues("qty");
           String [] itemcodes =  request.getParameterValues("itemcode");

//           for(String value: allQty){
//            out.print(value+" ");
//           }
//           out.print("</br>");
//
//           for(String itemcode: itemcodes){
//            out.print(itemcode+" ");
//           }

          // out.print(items.size());
           
          int z = items.size();  
          for(int i=0;i<z;i++ ){
             if(allQty[i].equals("0")){ 
                Item it = items.remove(itemcodes[i]); 
                out.print(it);
             }
          }

           hs.setAttribute("items", items);
           out.print("CCC");
        } finally { 
            out.close();
        }

above code "it" value is always null even allQty=zero..can anybody explain what will happen there..?? "items"s values all is associated with a specified key..

Edited by divsok: n/a

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by Airshow
0

This is the "JavaScript/DHTML/AJAX" forum.

That's a server-side script (JSP?).

Suggest you report your own post, SD, asking a moderator to move it to the right place.

Airshow

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.