variable values in loops

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • veremue
    New Member
    • Mar 2007
    • 14

    #1

    variable values in loops

    //Define Iterator iter

    String policyPath = "";
    while (iter.hasNext() )
    {
    deductionL = (DeductionsLoca l) iter.next();

    String policyID = deductionL.getP olicyID();

    policyL = policyH.findByP rimaryKey(polic yID);

    if(policyL.getS tatus().equalsI gnoreCase("READ Y TO GO INTO FORCE")||policy L.getStatus().e qualsIgnoreCase ("IN FORCE"))
    policyPath = "/NewBusiness/displayPolicyAp proved.jsp";
    else
    policyPath = Utils.getPolicy Path(policyL.ge tNextAction());



    //other code
    //end loop
    }

    why is it that policyPath has nothing for the rest of the iterations?
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by veremue
    //Define Iterator iter

    String policyPath = "";
    while (iter.hasNext() )
    {
    deductionL = (DeductionsLoca l) iter.next();

    String policyID = deductionL.getP olicyID();

    policyL = policyH.findByP rimaryKey(polic yID);

    if(policyL.getS tatus().equalsI gnoreCase("READ Y TO GO INTO FORCE")||policy L.getStatus().e qualsIgnoreCase ("IN FORCE"))
    policyPath = "/NewBusiness/displayPolicyAp proved.jsp";
    else
    policyPath = Utils.getPolicy Path(policyL.ge tNextAction());



    //other code
    //end loop
    }

    why is it that policyPath has nothing for the rest of the iterations?
    1.) Code tags code tags code tags code tags code tags code tags
    2.) What makes you sure that there's nothing in policyPath ?
    3.) If there is nothing, then the reason will be that the getPolicyPath in your Utils class did not return anything

    Comment

    Working...