You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mad Shop <jm...@yahoo.com> on 2007/08/21 14:51:56 UTC

Problem while converting JSP scriplet in to struts tags - Help requested

Following JSP scriplet is working fine
  <jsp:useBean id="costDistForm" class="CostDistForm" scope="session"/>
  
<%
float totalPaymentAmount = 0.0f;
List compItems = null;
compItems = costDistForm.getCompleteItems();
Iterator it = compItems.iterator();
while (it.hasNext()) 
{
   ItemCostRowForm row = (ItemCostRowForm)it.next();
   float payAmountSort = row.getPaymentAmountSort().floatValue();
   totalPaymentAmount = totalPaymentAmount + payAmountSort;
}
if(totalPaymentAmount < 1000.00)
{ 
%>
     <tr>
               <td> 
                      <b> Values is greater than 1000 </b>
               </td>
            </tr>  
<% 
}
%>
   
  When I tried to convert above scriptlet into Struts using nested:iterate I am getting null pointer exception
   
  <nested:notEmpty property="completeItems">
<nested:iterate property="completeItems" id="complete" indexId="completeIdx">
        <nested:write property="paymentAmountSort"/> 
 <nested:greaterEqual property="paymentAmountSort" value="1000.00"> 
      <tr>
             <td>
                    <b> Greater Equal 1000 </b> 
             </td>       
       </tr>
        <nested:greaterEqual>
</nested:iterate>
</nested:notEmpty>
  Can you please help me out in getting the correct struts equivalent for above scriplet!

       
---------------------------------
Boardwalk for $500? In 2007? Ha! 
Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.