Code:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ page import="java.util.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<table border="1">
<tr>
<td>name</td>
<td>department</td>
<td>Employee Id</td>
<td>salary</td>
</tr>
<%
ArrayList<Integer> id = (ArrayList)request.getAttribute("empid");
ArrayList<Integer> salary = (ArrayList)request.getAttribute("salary");
ArrayList<Integer> name = (ArrayList)request.getAttribute("name1");
ArrayList<Integer> dept = (ArrayList)request.getAttribute("dep");
%>
<%
if(id.size()>0)
{

	for(int i=0;i<id.size();i++)
	{
		%>
		<tr>
		<td><%=name.get(i)%>></td>
		<td><%=dept.get(i) %></td>
		<td><%=id.get(i) %></td>
		<td><%=salary%></td>
		</tr>
		<%
   }
}
   else { %>
		<tr>
		<td>No Entries Found</td>
		</tr>
		<%} %>
		
</table>

</body>
</html>

Last edited by shabbir; 9Dec2011 at 09:19.. Reason: Code blocks