[b]Caros, Boa Tarde!
alguém pode me ajudar?
estou concluindo um trabalho da facu, e surgiu uma dúvida, eu estou desenvolvendo uma mini loja virtual, e eu preciso mostrar os dados da tabela produtos no JSP, porém, tem um campo chamado categoria que faz parte de outra tabela, eu preciso mostrar o nome da categoria também.
Qual a melhor forma de fazer isso?[/b]
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!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>Editar Produtos</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<link href="file:///D|/Aplicações_Web/php/aplicações_php/css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" style="border:#006699 solid 1px">
<tr>
<td height="62" colspan="2" bgcolor="#eeeeee" class="titulo1"> Administração - Ver/editar produtos</td>
</tr>
<tr>
<td width="161" valign="top" style="border-right:#006699 solid 1px"></td>
<td width="597" valign="top">
<br></br>
<table width="100%" border="1" cellpadding="0" cellspacing="0">
[b]<jsp:useBean id="dao_prod" class = "Controle.Produto_DAO" />[/b]
<tr bgcolor="#eeeeee" class="menuadm">
<td width="8%" height="30">Cod produto</td>
<td width="35%" height="30">nome</td>
<td width="8%" height="30">Qtd estoque</td>
<td width="5%" height="30">Ativo</td>
<td width="13%" height="30">Categoria</td>
</tr>
<tr>
<c:forEach var = "produtos" items = "${dao_prod.lista}">
<td width="8%">${produtos.id_prod}</td>
<td width="35%" height="25%">${produtos.nome}</td>
<td width="8%">${produtos.qt_estoque}</td>
<td width="5%">${produtos.prod_ativo}</td>
[b]<td width="13%">${???.categoria}</td>[/b]
</c:forEach>
</tr>
<tr>
<td><a href="index.html">Voltar</a></td>
</tr>
</table>
<br></br>
<br></br></td>
</tr>
<tr>
<td colspan="2" bgcolor="#eeeeee"> </td>
</tr>
</table>
</body>
</html>