JSP page to display ArrayList elements using Iterator

By | May 30, 2015

An Example which explains how to display ArrayList elements using Iterator interface in java.


//ArrayList which contains list of subject names which is coming

ArrayList<Test> subjectList =(ArrayList) request.getAttribute("subjectList");
<form action="StudentController" name="formName" method="post" >
<table cellspacing="2" cellpadding="2">
<tr><th>Subject List</th><th>Select Test</th></tr>

// Iterating through subjectList
Iterator<Test> iterator = subjectList.iterator();
Test testBean = iterator.next();
<input type="radio" name="subject" value="<%=testBean.getSubjectId()%>"/>
<input type="submit" value="Take Test" />


Author: Ravi Bandakkanavar

A Techie, Blogger, Web Designer, Programmer by passion who aspires to learn new Technologies every day. It has been 6 years since I have been publishing articles and enjoying every bit of it. I want to share knowledge and build a great community with people like you.

Suggested articles for you:

Did it help? Comment here..

This site uses Akismet to reduce spam. Learn how your comment data is processed.