title: javax.el.PropertyNotFoundException IN SHOPPING CART
body: <p>I am working on a shopping cart but when i try to display the contents of cart it gives me an error called  <strong>HTTP Status 500 - javax.el.PropertyNotFoundException: Property 'IdNumber' not found on type Cart.CartItemBean –</strong>
  I am using a bean on Jsp to diplay the contents of cart.</p>
  
  <p><strong>ShoppingCart.jsp</strong></p>
  
  <pre><code>    &lt;%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %&gt;
      &lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt;
      &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;
      &lt;html&gt;
      &lt;head&gt;
           &lt;title&gt;Shopping Cart&lt;/title&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"&gt;
      &lt;/head&gt;
      &lt;body&gt;
  
          &lt;p&gt;&lt;font face="Verdana, Arial, Helvetica, sans-serif"&gt;&lt;strong&gt;Shopping Cart&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
          &lt;p&gt;&lt;a href="ModelList.jsp" mce_href="ModelList.jsp"&gt;Model List&lt;/a&gt; &lt;/p&gt;
          &lt;table width="75%" border="1"&gt;
              &lt;tr bgcolor="#CCCCCC"&gt; 
                  &lt;td&gt;&lt;strong&gt;&lt;font size="2" face="Verdana, Arial, Helvetica, sans-serif"&gt;Model 
                              Description&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;strong&gt;&lt;font size="2" face="Verdana, Arial, Helvetica, sans-serif"&gt;Quantity&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;strong&gt;&lt;font size="2" face="Verdana, Arial, Helvetica, sans-serif"&gt;Unit 
                              Price&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;
                  &lt;td&gt;&lt;strong&gt;&lt;font size="2" face="Verdana, Arial, Helvetica, sans-serif"&gt;Total&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;jsp:useBean id="cart" scope="session" class="Cart.CartBean"/&gt;
              &lt;c:if test="${cart.lineItemCount==0}"&gt;
                  &lt;tr&gt;
                      &lt;td colspan="4"&gt;&lt;font size="2" face="Verdana, Arial, Helvetica, sans-serif"&gt;- Cart is currently empty -&lt;br/&gt;
                  &lt;/tr&gt;
              &lt;/c:if&gt;
              &lt;c:forEach var="cartItem" items="${cart.cartItems}" varStatus="counter"&gt; 
                  &lt;form name="item" method="POST" action="CartController"&gt;
                      &lt;tr&gt; 
                          &lt;td&gt;&lt;font size="2" face="Verdana, Arial, Helvetica, sans-serif"&gt;&lt;b&gt;&lt;c:out value="${cartItem.partNumber}"/&gt;&lt;/b&gt;&lt;br/&gt;
                                  &lt;c:out value="${cartItem.modelDescription}"/&gt;&lt;/font&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;font size="2" face="Verdana, Arial, Helvetica, sans-serif"&gt;&lt;input type='hidden' name='itemIndex' value='&lt;c:out value="${counter.count}"/&gt;'&gt;&lt;input type='text' name="quantity" value='&lt;c:out value="${cartItem.quantity}"/&gt;' size='2'&gt; &lt;input type="submit" name="action" value="Update"&gt;
                                  &lt;input type="submit" name="action" value="Delete"&gt;&lt;/font&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;font size="2" face="Verdana, Arial, Helvetica, sans-serif"&gt;$&lt;c:out value="${cartItem.unitCost}"/&gt;&lt;/font&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;font size="2" face="Verdana, Arial, Helvetica, sans-serif"&gt;$&lt;c:out value="${cartItem.totalCost}"/&gt;&lt;/font&gt;&lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;/form&gt;
              &lt;/c:forEach&gt; 
  
              &lt;tr&gt; 
                  &lt;td colspan="2"&gt; &lt;/td&gt;
                  &lt;td&gt; &lt;/td&gt;
                  &lt;td&gt;&lt;font size="2" face="Verdana, Arial, Helvetica, sans-serif"&gt;Subtotal: $&lt;c:out value="${cart.orderTotal}"/&gt;&lt;/font&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>Cart.CartBean</strong></p>
  
  <pre><code>package Cart;
  
  import Cart.CartItemBean;
  
  import java.util.ArrayList;
  
  public class CartBean {
  
  private ArrayList alCartItems = new ArrayList();
  private double dblOrderTotal;
  int lineItemCount = alCartItems.size();
  
  public int getLineItemCount() {
      return lineItemCount;
  }
  
  public void deleteCartItem(String strItemIndex) {
  
      int iItemIndex = 0;
      try {
          iItemIndex = Integer.parseInt(strItemIndex);
          alCartItems.remove(iItemIndex - 1);
          calculateOrderTotal();
      } catch (NumberFormatException nfe) {
          System.out.println("Error while deleting cart item: " + nfe.getMessage());
          nfe.printStackTrace();
      }
  }
  
  public void updateCartItem(String strItemIndex, String strQuantity) {
      double dblTotalCost = 0.0;
      double dblUnitCost = 0.0;
      int iQuantity = 0;
      int iItemIndex = 0;
      CartItemBean cartItem = null;
      try {
          iItemIndex = Integer.parseInt(strItemIndex);
          iQuantity = Integer.parseInt(strQuantity);
          if (iQuantity &gt; 0) {
              cartItem = (CartItemBean) alCartItems.get(iItemIndex - 1);
              dblUnitCost = cartItem.getUnitCost();
              dblTotalCost = dblUnitCost * iQuantity;
              cartItem.setQuantity(iQuantity);
              cartItem.setTotalCost(dblTotalCost);
              calculateOrderTotal();
          }
      } catch (NumberFormatException nfe) {
          System.out.println("Error while updating cart: " + nfe.getMessage());
          nfe.printStackTrace();
      }
  
  }
  
  public void addCartItem(int strModelNo, String strDescription,
          String strUnitCost, String strQuantity) {
      double dblTotalCost = 0.0;
      double dblUnitCost = 0.0;
      int iQuantity = 0;
      CartItemBean cartItem = new CartItemBean();
      try {
          dblUnitCost = Double.parseDouble(strUnitCost);
          iQuantity = Integer.parseInt(strQuantity);
          if (iQuantity &gt; 0) {
              dblTotalCost = dblUnitCost * iQuantity;
              cartItem.setIdNumber(strModelNo);
              cartItem.setTitle(strDescription);
              cartItem.setUnitCost(dblUnitCost);
              cartItem.setQuantity(iQuantity);
              cartItem.setTotalCost(dblTotalCost);
              alCartItems.add(cartItem);
              calculateOrderTotal();
          }
  
      } catch (NumberFormatException nfe) {
          System.out.println("Error while parsing from String to primitive types: " + nfe.getMessage());
          nfe.printStackTrace();
      }
  }
  
  public void addCartItem(CartItemBean cartItem) {
      alCartItems.add(cartItem);
  }
  
  public CartItemBean getCartItem(int iItemIndex) {
      CartItemBean cartItem = null;
      if (alCartItems.size() &gt; iItemIndex) {
          cartItem = (CartItemBean) alCartItems.get(iItemIndex);
      }
      return cartItem;
  }
  
  public ArrayList getCartItems() {
      return alCartItems;
  }
  
  public void setCartItems(ArrayList alCartItems) {
      this.alCartItems = alCartItems;
  }
  
  public double getOrderTotal() {
      return dblOrderTotal;
  }
  
  public void setOrderTotal(double dblOrderTotal) {
      this.dblOrderTotal = dblOrderTotal;
  }
  
  protected void calculateOrderTotal() {
      double dblTotal = 0;
      for (int counter = 0; counter &lt; alCartItems.size(); counter++) {
          CartItemBean cartItem = (CartItemBean) alCartItems.get(counter);
          dblTotal += cartItem.getTotalCost();
  
      }
      setOrderTotal(dblTotal);
  }
  </code></pre>
  
  <p>}</p>
  
  <p><strong>Cart.CartItemBean</strong></p>
  
  <pre><code>package Cart;
  
  public class CartItemBean {
  
  public int IdNumber;
  private String Title;
  private String Image;
  private double dblUnitCost;
  private int iQuantity;
  private double dblTotalCost;
  
  public int getIdNumber() {
  
      return IdNumber;
  }
  
  public void setIdNumber(int IdNumber) {
      this.IdNumber = IdNumber;
  }
  
  public String getImage() {
      return Image;
  }
  
  public void setImage(String Image) {
      this.Image = Image;
  }
  
  public String getTitle() {
      return Title;
  }
  
  public void setTitle(String Title) {
      this.Title = Title;
  }
  
  public double getUnitCost() {
      return dblUnitCost;
  }
  
  public void setUnitCost(double dblUnitCost) {
      this.dblUnitCost = dblUnitCost;
  }
  
  public int getQuantity() {
      return iQuantity;
  }
  
  public void setQuantity(int quantity) {
      iQuantity = quantity;
  }
  
  public double getTotalCost() {
      return dblTotalCost;
  }
  
  public void setTotalCost(double dblTotalCost) {
      this.dblTotalCost = dblTotalCost;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Any help is highly appreciated</p>