title: getting and adding values together from a checkbox
body: <p>i currently have a servlet that displays some baseball cards and its values. i want to be able to list them in a checkbox and be able to choose the cards you want to sell. the servlet would then take the cards you checked and add those values up and show the total. i have most of it done except i cant get the values from the check boxs and sum them up.</p>
  
  <p>this is my jsp</p>
  
  <pre><code> &lt;form name="CashOut.jsp" method="post"&gt;
  &lt;table&gt;   
      &lt;c:forEach var="entry" items="${winingCards}"&gt;
          &lt;tr&gt;  
              &lt;td&gt;
                  &lt;input type="checkbox" name="cardvalue" value="${entry.price}"&gt;&lt;h1&gt;PRICE&lt;h1&gt;${entry.price}$&lt;/h1&gt;&lt;br&gt;&lt;img src="photofolio/images/cardimages/clevelandindians/${entry.name}.png" align="middle" style="max-height:25%; max-width:25% "/&gt;
              &lt;/td&gt;   
              &lt;/tr&gt;       
      &lt;/c:forEach&gt;     
  &lt;/table&gt;
  &lt;table&gt;
      &lt;tr&gt;
          &lt;td&gt;
              &lt;input type="submit" value="Submit"/&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>this mis my controller</p>
  
  <pre><code>protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          doGet(request, response);
           JFrame parent = new JFrame();
           int sumTotal = 0;
          String[] items =request.getParameterValues("cardvalue");
          for(String item : items){
  
               sumTotal=+sumTotal;
  
          }
  
           JOptionPane.showMessageDialog(parent, "You Cashed Out with: "+sumTotal);
           request.getRequestDispatcher( "/WEB-INF/photofolio/index.html" ).forward(
                   request, response );
          }
      }
  </code></pre>