HOME

JSP page to display ArrayList elements using for loop

An Example which explains how to display ArrayList elements using for loop.


//ArrayList which contains list of student details

<%
ArrayList <studentBean> arl=(ArrayList) request.getAttribute("studentBean");
%>

<table>
<tr>
<th>STUDENTID </th>
<th>FIRST NAME </th>
<th>LASTNAME</th>
<th>CLASS</th>

</tr>

<% try
{
for(int i=0;i<arl.size();i++)
{

<tr>
<td><%=arl.get(i).getstudentID()%></td>
<td><%=arl.get(i).getstudentFname()%></td>
<td><%=arl.get(i).getstudentLname()%></td>
<td><%=arl.get(i).getClass1()%></td>
</tr>
<%}
}
catch(Exception e)
{
System.out.println("Exception");
}
%>
</table>
.
Ravi Bandakkanavar

A Techie, Blogger, Web Designer, Programmer by passion who aspires to learn new Technologies every day. A founder of Krazytech. It's been 10+ years since I am publishing articles and enjoying every bit of it. I want to share the knowledge and build a great community with people like you.

Leave a Comment
Share
Published by
Ravi Bandakkanavar

Recent Posts

5 Ways Technology is Changing the World of Marketing

The marketing industry is continually evolving with new strategies and technologies catalyzing growth. To understand…

2 days ago

How Cyber Security is Changing in the World of Digital Technology

Cyber security is becoming increasingly critical as we move into the digital age. As the…

1 week ago

Everything You Need To Know About Create React App

The configuration of resources can be a time-consuming and difficult operation while creating a React…

1 month ago

Causes of CyberCrime and Preventive Measures

          Rapid technological growth and developments have provided vast areas of…

2 months ago

How Data Lineage will Improve Business Practices

How often have you thought about changing the way that you store and use data?…

2 months ago

10 Dominating Programming Language for Mobile App In 2022

Programming Languages are a set of rules that aid in transforming a concept into a…

2 months ago