Solucionado (ver solução)
Solucionado
(ver solução)
5
respostas

Dúbida no Ex. 1 da Aula 9 - Url amigáveis

Ao dar enter na url http://localhost:8080/casadocodigo/produtos/detalhe?id=4, ocorre o seguinte erro:

Hibernate: select distinct produto0.id as id1_0, produto0.dataLancamento as dataLanc2_0, produto0.descricao as descrica3_0, produto0.paginas as paginas4_0, produto0.sumarioPath as sumarioP5_0, produto0.titulo as titulo6_0, precos1.Produtoid as Produto1_0_0, precos1.tipo as tipo210_, precos1.valor as valor310_ from Produto produto0 inner join Produtoprecos precos1 on produto0.id=precos1.Produtoid where produto0.id=? May 24, 2016 5:38:50 PM org.apache.jasper.compiler.TldLocationsCache tldScanJar INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. May 24, 2016 5:38:50 PM org.apache.catalina.core.ApplicationDispatcher invoke SEVERE: Servlet.service() for servlet jsp threw exception org.apache.jasper.JasperException: /WEB-INF/views/produtos/detalhe.jsp (line: 99, column: 30) quote symbol expected at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:443) at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:89) at org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:224) at org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:162) at org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:153) at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1229) at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1446) at org.apache.jasper.compiler.Parser.parse(Parser.java:138) at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:242) at org.apache.jasper.compiler.ParserController.parse(ParserController.java:102) at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:199) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:374) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:341) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:662) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:364) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:747) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:485) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:410) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:337) at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:172) at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1228) at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1011) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:955) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) at javax.servlet.http.HttpServlet.service(HttpServlet.java:624) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)

May 24, 2016 5:38:50 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [dispatcher] in context with path [/casadocodigo] threw exception [/WEB-INF/views/produtos/detalhe.jsp (line: 99, column: 30) quote symbol expected] with root cause org.apache.jasper.JasperException: /WEB-INF/views/produtos/detalhe.jsp (line: 99, column: 30) quote symbol expected at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42) at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:443) at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:89) at org.apache.jasper.compiler.Parser.parseAttribute(Parser.java:224) at org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:162) at org.apache.jasper.compiler.Parser.parseAttributes(Parser.java:153) at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1229) at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1446) at org.apache.jasper.compiler.Parser.parse(Parser.java:138) at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:242) at org.apache.jasper.compiler.ParserController.parse(ParserController.java:102) at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:199) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:374) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:354) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:341) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:662) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:364) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:747) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:485) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:410) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:337) at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:172) at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1228) at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1011) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:955) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852) at javax.servlet.http.HttpServlet.service(HttpServlet.java:624) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)

Não consegui identificar erro na página.

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>

${produto.titulo }

${produto.descricao }

  • ${preco.tipo } R$ 39,90

    {preco.valor }

Dados do livro:

Número de Páginas: ${produto.paginas }

Data de publicação: ${produto.dataLancamento }

Encontrou um erro? Submeta uma errata

'''

CONTROLLER

'''

@RequestMapping("/detalhe") public ModelAndView detalhe(Integer id) { ModelAndView modelAndView = new ModelAndView("produtos/detalhe"); Produto produto = produtoDAO.find(id); modelAndView.addObject("produto", produto);

return modelAndView; }

'''

dao

'''

public Produto find(Integer id) { return manager.createQuery("select distinct(p) from Produto p join fetch p.precos precos where p.id = :id", Produto.class).setParameter("id", id).getSingleResult(); }

''''

5 respostas

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>
    <c:url value="/" var="contextPath" />
      <meta charset="utf-8"/>
          <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
          <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
        <link rel="icon" href="//cdn.shopify.com/s/files/1/0155/7645/t/177/assets/favicon.ico?11981592617154272979"    type="image/ico" />
        <link href="https://plus.googlecom/108540024862647200608" rel="publisher"/>
        <title>Livros de Java, SOA, Android, iPhone, Ruby on Rails e
            muito mais - Casa do Código</title>
        <link href="${contextPath}resources/css/cssbase-min.css"
            rel="stylesheet" type="text/css" media="all" />
        <link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700'
            rel='stylesheet'/>
        <link href="${contextPath}resources/css/fonts.css"
            rel="stylesheet" type="text/css" media="all" />
        <link href="${contextPath}resources/css/fontello-ie7.css"
            rel="stylesheet" type="text/css" media="all" />
        <link href="${contextPath}resources/css/fontello-embedded.css"
            rel="stylesheet" type="text/css" media="all" />
        <link href="${contextPath}resources/css/fontello.css"
            rel="stylesheet" type="text/css" media="all" />
        <link href="${contextPath}resources/css/style.css"
            rel="stylesheet" type="text/css" media="all" />
        <link href="${contextPath}resources/css/layout-colors.css"
            rel="stylesheet" type="text/css" media="all" />
        <link href="${contextPath}resources/css/responsive-style.css"
            rel="stylesheet" type="text/css" media="all" />
        <link href="${contextPath}resources/css/guia-do-programador-style.css" 
            rel="stylesheet" type="text/css"  media="all"  />
        <link href="${contextPath}resources/css/produtos.css" 
            rel="stylesheet" type="text/css"  media="all"  />
        <link rel="canonical" href="http://www.casadocodigo.com.br/" />    
</head>
<body>
  <header id="layout-header">
        <div class="clearfix container">
            <a href="/" id="logo">
            </a>
            <div id="header-content">
                <nav id="main-nav">

                    <ul class="clearfix">
                        <li><a href="/carrinho" rel="nofollow">Carrinho</a></li>

                        <li><a href="/pages/sobre-a-casa-do-codigo" rel="nofollow">Sobre Nós</a></li>

                        <li><a href="/pages/perguntas-frequentes" rel="nofollow">Perguntas Frequentes</a></li>
                    </ul>
                </nav>
            </div>
        </div>
    </header>
    <nav class="categories-nav">
        <ul class="container">
            <li class="category"><a href="http://www.casadocodigo.com.br">Home</a></li>
            <li class="category"><a href="/collections/livros-de-agile">
                    Agile </a></li>
            <li class="category"><a href="/collections/livros-de-front-end">
                    Front End </a></li>
            <li class="category"><a href="/collections/livros-de-games">
                    Games </a></li>
            <li class="category"><a href="/collections/livros-de-java">
                    Java </a></li>
            <li class="category"><a href="/collections/livros-de-mobile">
                    Mobile </a></li>
            <li class="category"><a
                href="/collections/livros-desenvolvimento-web"> Web </a></li>
            <li class="category"><a href="/collections/outros"> Outros </a></li>
        </ul>
    </nav>

    <article id="${produto.id }">
          <header id="product-highlight" class="clearfix">
            <div id="product-overview" class="container">
              <img width="280px" height="395px" src="http://cdn.shopify.com/s/files/1/0155/7645/products/css-eficiente-featured_large.png?v=1435245145" class="product-featured-image" />
              <h1 class="product-title">${produto.titulo }</h1>
              <p class="product-author">
                <span class="product-author-link">

                </span>
              </p>    

            <p class="book-description">
                ${produto.descricao }
            </p>
            </div>
          </header>


      <section class="buy-options clearfix">  
      <form action="/carrinho/add" method="post" class="container">
        <ul id="variants" class="clearfix">
            <input type="hidden" value="${produto.id }" name="produtoId" />
              <c:forEach items="" var=preco>
              <li class="buy-option">
                <input type="radio" name="tipo" class="variant-radio" id="tipo" value="${preco.tipo }"  checked="checked"  />
                <label  class="variant-label">
                  ${preco.tipo }
                </label>
                <small class="compare-at-price">R$ 39,90</small>
                <p class="variant-price">{preco.valor }</p>
              </li> 
            </c:forEach>          
        </ul>
        <button type="submit" class="submit-image icon-basket-alt" alt="Compre Agora" title="Compre Agora '${produto.titulo }"></button>

      </form>

    </section>

    <div class="container">
      <section class="summary">
        <ul>
              <li><h3>E muito mais... <a href='/pages/sumario-java8'>veja o sumárioio</a>.</h3></li>
        </ul>
      </section>

      <section class="data product-detail">
        <h2 class="section-title">Dados do livro:</h2>
        <p>Número de Páginas: <span>${produto.paginas }</span></p>
        <p></p>
        <p>Data de publicação: <span>${produto.dataLancamento }</span> </p>
        <p>Encontrou um erro? <a href='/submissao-errata' target='_blank'>Submeta uma errata</a></p>
      </section>
    </div>

    </article>    

    <footer id="layout-footer">
        <div class="clearfix container">
            <div id="collections-footer">
                <!-- cdc-footer -->
                <p class="footer-title">Coleções de Programação</p>
                <ul class="footer-text-links">
                    <li><a href="/collections/livros-de-java">Java</a></li>
                    <li><a href="/collections/livros-desenvolvimento-web">Desenvolvimento
                            Web</a></li>
                    <li><a href="/collections/livros-de-mobile">Mobile</a></li>
                    <li><a href="/collections/games">Games</a></li>
                    <li><a href="/collections/livros-de-front-end">Front End</a></li>
                </ul>
                <p class="footer-title">Outros Assuntos</p>
                <ul class="footer-text-links">
                    <li><a href="/collections/livros-de-agile">Agile</a></li>
                    <li><a href="/collections/outros">e outros...</a></li>
                </ul>
            </div>
            <div id="social-footer">
                <!-- books-footer -->
                <p class="footer-title">Links da Casa do Código</p>
                <ul class="footer-text-links">
                    <li><a href="http://livros.casadocodigo.com.br" rel="nofollow">Meus
                            E-books</a></li>
                    <li><a href="/pages/sobre-a-casa-do-codigo">Sobre a Casa
                            do Código</a></li>
                    <li><a href="/pages/perguntas-frequentes">Perguntas
                            Frequentes</a></li>
                    <li><a href="https://www.caelum.com.br">Caelum - Ensino e
                            Inovação</a></li>
                    <li><a href="http://www.codecrushing.com/" rel="nofollow">Code
                            Crushing</a></li>
                    <li><a
                        href="http://www.casadocodigo.com.br/pages/politica-de-privacidade"
                        rel="nofollow">Política de Privacidade</a></li>
                </ul>
                <p class="footer-title">Redes Sociais</p>
                <ul>
                    <li class="social-links"><a
                        href="http://www.twitter.com/casadocodigo" target="_blank"
                        id="twitter" rel="nofollow">Facebook</a> <a
                        href="http://www.facebook.com/casadocodigo" target="_blank"
                        id="facebook" rel="nofollow">Twitter</a></li>
                </ul>
            </div>
            <div id="newsletter-footer">
                <!-- social-footer -->
                <p class="footer-title">Receba as Novidades e Lançamentos</p>
                <div id="form-newsletter">
                    <form
                        action=""
                        method="POST" id="ss-form" class="form-newsletter">
                        <ul>
                            <li><input type="hidden" name="pageNumber" value="0"/><input
                                type="hidden" name="backupCache" value=""/><input
                                type="email" name="entry.0.single" value="" class="ss-q-short"
                                id="entry_0" placeholder="seu@email.com"/></li>
                            <li><input type="submit" name="submit"
                                value="Quero Receber!" id="submit-newsletter"/></li>
                        </ul>
                    </form>
                    <ul>
                        <li class="ie8"><a
                            href=""
                            rel="nofollow">Receba as Novidades e Lançamentos</a></li>
                    </ul>
                </div>
                <ul class="footer-payments">
                    <li></li>
                    <li></li>
                </ul>
            </div>
        </div>
    </footer>
</body>
</html>

DAO

@Repository
@Transactional
public class ProdutoDAO {

    @PersistenceContext
    private EntityManager manager;

    public void gravar(Produto produto) {
        manager.persist(produto);
    }

    public List<Produto> listar() {
        return manager.createQuery("select p from Produto p", Produto.class).getResultList();
    }

    public Produto find(Integer id) {
        return manager.createQuery("select distinct(p) from Produto p join fetch p.precos precos where p.id = :id", 
                Produto.class).setParameter("id", id).getSingleResult();
    }


}

CONTROLLER


@Controller
@RequestMapping("/produtos")
public class ProdutosController {

    @Autowired
    private ProdutoDAO produtoDAO;

    @Autowired
    private FileSaver fileSaver;

    @InitBinder
    public void initBinder(WebDataBinder binder) {
        binder.addValidators(new ProdutoValidation());
        new ProdutoValidation();
    }

    @RequestMapping("/form")
    public ModelAndView form(Produto produto) {
        ModelAndView modelAndView = new ModelAndView("produtos/form");
        modelAndView.addObject("tipos", TipoPreco.values());

        return modelAndView;
    }

    @RequestMapping(method=RequestMethod.POST)
    public ModelAndView gravar(MultipartFile sumario, @Valid Produto produto, BindingResult result, 
            RedirectAttributes redirectAttributes) {        

        if (result.hasErrors()) {
            return form(produto);
        }

        String path = fileSaver.write("arquivos", sumario);
        produto.setSumarioPath(path);

        produtoDAO.gravar(produto);
        redirectAttributes.addFlashAttribute("sucesso", "Produto cadastrado com sucesso!");

        return new ModelAndView("redirect:produtos");
    }

    @RequestMapping(method=RequestMethod.GET)
    public ModelAndView listar() {
        List<Produto> produtos = produtoDAO.listar();
        ModelAndView modelAndView = new ModelAndView("produtos/lista");
        modelAndView.addObject("produtos", produtos);

        return modelAndView;
    }

    @RequestMapping("/detalhe")
    public ModelAndView detalhe(Integer id) {
        ModelAndView modelAndView = new ModelAndView("produtos/detalhe");
        Produto produto = produtoDAO.find(id);
        modelAndView.addObject("produto", produto);

        return modelAndView;
    }

}
solução!

Encontrei um erro na jsp.

Acabei solucionando reescrevendo o jsp.

Boa noite!

Renato pode mencionar o erro na JSP?