Olá! No meu lista.jsp não está listando os produtos, traz somente o cabeçalho da tabela. E não estou conseguindo debugar para identificar o problema.
Alguém pode me ajudar, por favor?
Segue código do ProdutoController:
package br.com.caelum.vraptor.controller;
import java.util.List;
import javax.persistence.EntityManager;
import br.com.caelum.vraptor.Controller;
import br.com.caelum.vraptor.Path;
import br.com.caelum.vraptor.dao.ProdutoDao;
import br.com.caelum.vraptor.model.Produto;
import br.com.caelum.vraptor.util.JPAUtil;
@Controller
public class ProdutoController {
@Path("/")
public void inicio(){
}
@Path("/produto/lista")
public List<Produto> lista(){
EntityManager em = JPAUtil.criaEntityManager();
ProdutoDao dao = new ProdutoDao(em);
return dao.lista();
}
@Path("/produto/sobre")
public void sobre(){
}
}
e o código do lista.jsp
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<link rel="stylesheet" type="text/css" href="../bootstrap/css/bootstrap.css">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<div class="container">
<h1>Lista de produtos</h1>
<table class="table table-stripped table-over table-bordered">
<thead>
<tr>
<th>Nome</th>
<th>Valor</th>
<th>Quantidade</th>
</tr>
</thead>
<tbody>
<c:forEach items="${productList}" var="produto">
<tr>
<td>${produto.nome}</td>
<td>${produto.valor}</td>
<td>${produto.quantidade}</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</body>
</html>