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..

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.