Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: In JSP i am Getting java.util.NoSuchElementException

  1. #1
    Junior Member
    Join Date
    Nov 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default In JSP i am Getting java.util.NoSuchElementException

    Hi All,
    I am getting java.util.NoSuchElementException, i did work on this it is seems like that iterator doesn't contains any elements ,Please find the following code

    Please find the LINK for more informatIn JSP i am Getting java.util.NoSuchElementException (Spring forum at JavaRanch)

    In Spring Congtroller class:
    try {
    list=adminService.getAdminDetails();
    } catch (CMSServiceException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
    mav.addObject("list", list);
    return mav;
    }
    Here is list size coming around 7(records in Database ) But that DB valus not showing in jsp page ..
    <table border="1" width="303">
    <tr>
    <td width="168"><b>USERNAME</b></td>
    <td width="168"><b>Emp ID</b></td>
    </tr>
    <%int i = 1;%>
    <%Iterator itr;%>
    <% List data= (List)request.getAttribute("list");
    for (itr=data.iterator(); itr.hasNext(); )
    {
    %>
    <tr>
    <td width="168"><%=itr.next()%></td>
    <td width="168"><%=itr.next()%></td>
    </tr>
    <%} %>
    </table>
    Kindly suggest us,as earlist


    Thanks
    Anji
    In JSP i am Getting java.util.NoSuchElementException (Spring forum at JavaRanch)In JSP i am Getting java.util.NoSuchElementException (Spring forum at JavaRanch)


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,045
    My Mood
    Mellow
    Thanks
    184
    Thanked 649 Times in 636 Posts

    Default Re: In JSP i am Getting java.util.NoSuchElementException

    Welcome to the Forum! Please read this topic to learn how to post code correctly and other useful tips for newcomers.

    Please post your code correctly per the above link.

Similar Threads

  1. [SOLVED] both class javax.swing.Timer in javax.swing and class java.util.Timer in java.util match
    By stresstedout in forum What's Wrong With My Code?
    Replies: 13
    Last Post: April 10th, 2014, 07:32 PM
  2. Replies: 4
    Last Post: April 16th, 2013, 06:50 AM
  3. java.util.NoSuchElementException
    By xSedated in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 24th, 2013, 06:03 AM
  4. Replies: 11
    Last Post: August 30th, 2012, 02:30 PM
  5. NoSuchElementException
    By chantal001 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 30th, 2011, 11:13 AM