olá!!
Não estou conseguindo realizar corretamente o redirect, já alterei diversas vezes o RequestMapping, porém, não consigo mais cadastrar (coisa que fazia antes) e nem redirecionar, poderiam me ajudar por favor?
de vez de produto é aluno, a pasta produtos renomeei para a pasta projeto
obrigada!!
AlunoController.java
package br.com.projeto.cuidandodaatencao.controllers;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import br.com.projeto.cuidandodaatencao.dao.AlunoDAO;
import br.com.projeto.cuidandodaatencao.model.Aluno;
@RequestMapping("projeto")
@Controller
public class AlunoController {
    @Autowired /* spring ejetar o DAO */
    private AlunoDAO alunoDAO; 
    @RequestMapping("/CadastroAluno")    
     public ModelAndView form(){
            ModelAndView modelAndView = new ModelAndView("projeto/CadastroAluno");
        return modelAndView;
    }
    @RequestMapping(method=RequestMethod.POST)
    public ModelAndView gravar(Aluno aluno, RedirectAttributes redirectAttributes) {
        System.out.println(aluno);
        alunoDAO.gravar(aluno);
        redirectAttributes.addFlashAttribute("sucesso", "Aluno Cadastrado");
        return new ModelAndView("redirect:projeto");
        }
       @RequestMapping(method=RequestMethod.GET)
        public ModelAndView listar() {
           List<Aluno> alunos = alunoDAO.listar();
           ModelAndView modelAndView = new ModelAndView("projeto/ListaDeAlunos");
          modelAndView.addObject("alunos", alunos);
            return modelAndView;
        }
}ListaDeAlunos.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Cuidando da Atenção</title>
</head>
<body>
    <h1>Lista de Alunos</h1>
    <div>${sucesso }</div>
    <table>
        <tr>
            <td>Nome</td>
            <td>Idade</td>
            <td>Serie</td>
        </tr>
        <c:forEach items="${alunos}" var="aluno">
            <tr>
                <td>${aluno.nome}</td>
                <td>${aluno.idade}</td>
                <td>${aluno.serie}</td>
            </tr> 
        </c:forEach>
    </table>
</body>
</html> 
            