
How do u display the list of employee object in JSP page?

display.jsp
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="core" %>
<%@ page isELIgnored="false" %>
<%@ page import="java.util.List,java.util.ArrayList" %>
<%
List<Employee> empList=new ArrayList();
Employee emp=new Employee();
emp.setEno(123);
emp.setEname("asmit");
empList.add(emp);
emp=new Employee();
emp.setEno(124);
emp.setEname("reoseinida");
empList.add(emp);
pageContext.setAttribute("empList",empList);
%>
<table>
<tr>
<td>Emp no</td>
<td> Emp Name</td>
</tr>
<c:forEach var="emp" items="${empList}" >
<tr>
<td> ${emp.eno}</td>
<td>${emp.ename}</td>
</tr>
</c:forEach>
<table>
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.