Estou estudando useBean e criei a página abaixo, que não está funcionando.
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page import="java.util.*, DAO.*, classes.*" %>
<jsp:useBean id="prodDaoBean" class="DAO.ProdDao" scope="session" />
<jsp:useBean id="prodBean" class="classes.Prod" scope="session" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Consulta Produtos </title>
</head>
<body>
<table>
<tr>
<th> Código do produto</th>
<th> descrição do produto</th>
</tr>
<%
for (Prod prod : prodDaoBean.consultaTodos()) {
%>
<tr>
<td> <jsp:getProperty property="codigo" name="prodBean"/> </td>
<td> <jsp:getProperty property="descricao" name="prodBean"/> </td>
</tr>
<% }%>
</table>
</body>
</html>
assim funciona:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page import="java.util.*, DAO.*, classes.*" %>
<jsp:useBean id="prodDaoBean" class="DAO.ProdDao" scope="session" />
<jsp:useBean id="prodBean" class="classes.Prod" scope="session" />
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Consulta produto</title>
</head>
<body>
<table>
<tr>
<th> Código do produto</th>
<th> descrição do produto</th>
</tr>
<%
for Prod prod : prodDaoBean.consultaTodos()) {
%>
<tr>
<td> <%=prod.getCodigo()%> </a> </td>
<td> <%=prod.getDescricao()%> </td>
</tr>
<% }%>
</table>
</body>
</html>