I need to show data from a PL SQL table for an assignment. I got the result as a HashMap and passed it to a JSP page. How can I show these data in a table ? Can I use HTML tags inside JSTL tags like this ?
<c:forEach items="${employees}" var="employee">
<td>${employee.name}</td>
<td>${employee.city}</td>
<td>${employee.salary}</td>
<c:forEach>
Or are thre any other technique to print a table in a JSP page using PL SQL ???
EDIT: This is my code:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Employee Details</h1>
<form action="handler" method="post">
<table>
<tr>
<td>Employee ID</td>
<td>First Name</td>
<td>Last Name</td>
<td>Start Date</td>
<td>End Date</td>
<td>Salary</td>
<td>City</td>
<td>Description</td>
</tr>
<c:forEach items="${employees}" var="employee">
<tr>
<td>${employee.value.id}</td>
<td>${employee.value.fName}</td>
<td>${employee.value.lName}</td>
<td>${employee.value.startD}</td>
<td>${employee.value.endD}</td>
<td>${employee.value.salary}</td>
<td>${employee.value.city}</td>
<td>${employee.value.desc}</td>
</tr>
</c:forEach>
</table>
</form>
</body>
</html>
EDIT 2:
This is how I created my HashMap:
while (rs.next()) {
employee = new Employee(
rs.getString("EMPLOYEEID"),
rs.getString("FIRST_NAME"),
rs.getString("LAST_NAME"),
rs.getString("START_DATE"),
rs.getString("END_DATE"),
rs.getString("SALARY"),
rs.getString("CITY"),
rs.getString("DESCRIPTION")
);
System.out.println(employee.toString());
employees.put(rs.getString("EMPLOYEEID"), employee);