title: JSF 'total' variable something like c:set in JSTL
body: <p>I don't like JSF but I need to solve this problem with it, I am working in "pure" JSF.
  So this is what I baisicly need but I don't know how to accomplish it with JSF:</p>
  
  <pre><code>&lt;c:set var="total" value="0"&gt;&lt;/c:set&gt;
  
  &lt;c:forEach var="item" items="${cart}"&gt;
      &lt;tr&gt;
          &lt;td&gt;${item.product.name}&lt;/td&gt;
          &lt;td&gt;${item.product.price}&lt;/td&gt;
          &lt;td&gt;${item.quantity}&lt;/td&gt;
          &lt;td&gt;${item.product.price * item.quantity}&lt;/td&gt;
      &lt;/tr&gt;
      &lt;c:set var="total" value="${total + item.product.price * item.quantity}"&gt;&lt;/c:set&gt;
  &lt;/c:forEach&gt;
  </code></pre>
  
  <p>Now I can display total value with simple ${total} as u know.</p>
  
  <p>My JSF table looks like this:</p>
  
  <pre><code>    &lt;h:dataTable var="item" value="#{mbProducts.cart_items}" binding="#{mbProducts.tableComponent}" border="1"&gt;
  
          &lt;h:column&gt;
              &lt;f:facet name="header"&gt;
                  &lt;h:outputText value="NAME" /&gt;
              &lt;/f:facet&gt;
  
              &lt;h:outputText value="#{item.product.name}" /&gt;
          &lt;/h:column&gt;
  
          &lt;h:column&gt;
              &lt;f:facet name="header"&gt;
                  &lt;h:outputText value="PRICE" /&gt;
              &lt;/f:facet&gt;
  
              &lt;h:outputText value="#{item.product.price}" /&gt;
          &lt;/h:column&gt;
  
          &lt;h:column&gt;
              &lt;f:facet name="header"&gt;
                  &lt;h:outputText value="NUM" /&gt;
              &lt;/f:facet&gt;
  
              &lt;h:outputText value="#{item.quantity}" /&gt;
          &lt;/h:column&gt;
  
          &lt;h:column&gt;
              &lt;f:facet name="header"&gt;
                  &lt;h:outputText value="TOTAL PRICE" /&gt;
              &lt;/f:facet&gt;
  
              &lt;h:outputText value="#{item.product.price * item.quantity}"/&gt;
          &lt;/h:column&gt;
  
      &lt;/h:dataTable&gt;
  </code></pre>
  
  <p>But I don't know how to set total variable which will be increased in each iteration?
  How to solve this?!</p>