olá pessoal, estou recebendo esse erro
type Exception report
message An exception occurred processing JSP page /WEB-INF/views/carrinho/itens.jsp at line 110
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /WEB-INF/views/carrinho/itens.jsp at line 110
107: <tr>
108:
109: <td class="cart-img-col"><img src="http://cdn.shopify.com/s/files/1/0155/7645/products/css-eficiente-featured_large.png?v=1435245145" width="71px" height="100px"/></td><td class="item-title">T�TULO DO LIVRO AQUI</td>
110: <td class="item-title"> ${item.Produto.titulo }</td>
111: <td class="numeric-cell">${item.tipoPreco }</td>
112: <td class="quantity-input-cell"><input type="number" min="0" readonly="readonly" id="quantidade" name="quantidade"
113: value="${carrinhoCompras.getQuantidade(item)}" /></td>
Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:172)
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1228)
org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1011)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:955)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
root cause
javax.el.PropertyNotFoundException: Property 'Produto' not found on type java.lang.String
javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:229)
javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:206)
javax.el.BeanELResolver.property(BeanELResolver.java:317)
javax.el.BeanELResolver.getValue(BeanELResolver.java:85)
org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:104)
org.apache.el.parser.AstValue.getValue(AstValue.java:183)
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:185)
org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:1026)
org.apache.jsp.WEB_002dINF.views.carrinho.itens_jsp._jspx_meth_c_005fforEach_005f0(itens_jsp.java:375)
org.apache.jsp.WEB_002dINF.views.carrinho.itens_jsp._jspService(itens_jsp.java:207)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:172)
org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303)
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1228)
org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1011)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:955)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
package org.SpringMvc.loja.modelos;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.web.context.WebApplicationContext;
import com.sun.org.apache.xml.internal.security.utils.ElementCheckerImpl.InternedNsChecker;
import com.sun.xml.internal.ws.developer.Serialization;
@Component
@Scope(value=WebApplicationContext.SCOPE_SESSION)
public class CarrinhoCompras implements Serializable {
private static final long serialVersionUID = 1L;
private Map<CarrinhoItem, Integer> itens = new LinkedHashMap<>();
public void add(CarrinhoItem item) {
itens.put(item, getQuantidade(item) + 1);
}
public Integer getQuantidade(CarrinhoItem item) {
if (!itens.containsKey(item)) {
itens.put(item, 0);
}
return itens.get(item);
}
public int getQuantidade() {
return itens.values().stream().reduce(0, (proximo, acumulador) -> proximo + acumulador);
}
public BigDecimal getTotal(CarrinhoItem item){
return item.getTotal(getQuantidade(item));
}
public BigDecimal getTotal(){
BigDecimal total = BigDecimal.ZERO;
for(CarrinhoItem item : itens.keySet()){
total = total.add(getTotal(item));
}
return total;
}
public Collection<CarrinhoItem> getItens() {
return this.itens.keySet();
}
}
package org.SpringMvc.loja.modelos;
import java.io.Serializable;
import java.math.BigDecimal;
public class CarrinhoItem implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private Produto produto;
private TipoPreco tipoPreco;
public Produto getProduto() {
return this.produto;
}
public void setProduto(Produto produto) {
this.produto = produto;
}
public TipoPreco getTipoPreco() {
return tipoPreco;
}
public void setTipoPreco(TipoPreco tipoPreco) {
this.tipoPreco = tipoPreco;
}
public CarrinhoItem(Produto produto, TipoPreco tipoPreco) {
this.produto = produto;
this.tipoPreco = tipoPreco;
}
public BigDecimal getPreco(){
return produto.precoPara(tipoPreco);
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((produto == null) ? 0 : produto.hashCode());
result = prime * result + ((tipoPreco == null) ? 0 : tipoPreco.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
CarrinhoItem other = (CarrinhoItem) obj;
if (produto == null) {
if (other.produto != null)
return false;
} else if (!produto.equals(other.produto))
return false;
if (tipoPreco != other.tipoPreco)
return false;
return true;
}
public BigDecimal getTotal(int quantidade) {
return this.getPreco().multiply(new BigDecimal(quantidade));
}
}
itens.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="s" %>
<!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="${s:mvcUrl('CCC#itens').build() }" rel="nofollow">Carrinho (${carrincoCompras.quantidade})</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>
<section class="container middle">
<h2 id="cart-title">Seu carrinho de compras</h2>
<table id="cart-table">
<colgroup>
<col class="item-col"/>
<col class="item-price-col"/>
<col class="item-quantity-col"/>
<col class="line-price-col"/>
<col class="delete-col"/>
</colgroup>
<thead>
<tr>
<th class="cart-img-col"></th>
<th width="65%">Item</th>
<th width="10%">Preço</th>
<th width="10%">Quantidade</th>
<th width="10%">Total</th>
<th width="5%"></th>
</tr>
</thead>
<tbody>
<c:forEach items="${carrinhoCompras.itens} " var="item">
<tr>
<td class="cart-img-col"><img src="http://cdn.shopify.com/s/files/1/0155/7645/products/css-eficiente-featured_large.png?v=1435245145" width="71px" height="100px"/></td><td class="item-title">TÍTULO DO LIVRO AQUI</td>
<td class="item-title"> ${item.produto.titulo }</td>
<td class="numeric-cell">${item.tipoPreco }</td>
<td class="quantity-input-cell"><input type="number" min="0" readonly="readonly" id="quantidade" name="quantidade"
value="${carrinhoCompras.getQuantidade(item)}" /></td>
<td class="numeric-cell">${carrinhoCompras.getTotal(item)}</td>
<td class="remove-item">
<form action="" method="POST">
<input type="image"
src="http:////cdn.shopify.com/s/files/1/0155/7645/t/177/assets/excluir.png?157580795780530083"
alt="Excluir" title="Excluir"/></td>
</form>
</tr>
</c:forEach>
</tbody>
<tfoot>
<tr>
<td colspan="3"><input type="submit" class="checkout" name="checkout" value="Finalizar compra" /></td>
<td class="numeric-cell">${carrinhoCompras.total}</td>
<td class="quantity-input-cell"><input type="submit" class="update-cart" disabled="disabled" name="update" value=""/></td>
</tr>
</tfoot>
</table>
<h2>Você já conhece os outros livros da Casa do Código?</h2>
<ul id="collection" class="related-books">
<li class="col-left">
<a href="/products/livro-plsql" class="block clearfix book-suggest" data-book="PL/SQL: Domine a linguagem do banco de dados Oracle">
<img width="113px" height="160px" src="http:////cdn.shopify.com/s/files/1/0155/7645/products/plsql-featured_compact.png?v=1434740236" alt="PL/SQL: Domine a linguagem do banco de dados Oracle"/>
</a>
</li>
</ul>
<h2><a href="http://www.casadocodigo.com.br">Veja todos os livros que publicamos!</a></h2>
</section>
<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>
package org.SpringMvc.loja.controller;
import org.SpringMvc.loja.daos.ProdutoDAO;
import org.SpringMvc.loja.modelos.CarrinhoCompras;
import org.SpringMvc.loja.modelos.CarrinhoItem;
import org.SpringMvc.loja.modelos.Produto;
import org.SpringMvc.loja.modelos.TipoPreco;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.ModelAndView;
@Controller
@Scope(value=WebApplicationContext.SCOPE_REQUEST)
@RequestMapping("/carrinho")
public class CarrinhoComprasController{
@Autowired
private ProdutoDAO produtoDAO;
@Autowired
private CarrinhoCompras carrinho;
@RequestMapping("/add")
public ModelAndView add(Integer produtoId, TipoPreco tipoPreco){
ModelAndView modelAndView = new ModelAndView("redirect:/carrinho");
CarrinhoItem carrinhoItem = criaItem(produtoId,tipoPreco);
carrinho.add(carrinhoItem);
return modelAndView;
}
@RequestMapping(method=RequestMethod.GET)
public ModelAndView itens(){
System.out.println("acessando carrinho/itens");
return new ModelAndView("/carrinho/itens");
}
private CarrinhoItem criaItem(Integer produtoId, TipoPreco tipoPreco) {
Produto produto=produtoDAO.find(produtoId);
CarrinhoItem carrinhoItem = new CarrinhoItem(produto, tipoPreco);
return carrinhoItem;
}
}