Olá, Estou desenvolvendo uma loja virtual em Java utilizando o Framewrk Struts, o projeto é para o PFC da Faculdade e tem de ser feito com Struts no entanto o mesmo esta me dando bastante problema.
Por favor me ajudem a encontrar o porque dos paus que estão dando n meu projeto.
Fontes****
---------------------carrinho.jsp--------------------------
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix=“logic”%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix=“bean”%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix=“html”%>
<html:html>
<head>
<title>Carrinho de Compras</title>
<html:base/>
</head>
<body>
<h2 align=“center”>Seu Carrinho de Compras</h2>
<br>
<logic:greaterThan scope=“session” name=“carrinho” property=“tamanho” value=“0”>
<form action=“carrinho.do?method=atualizar” method=“post”>
<table border=“1” bordercolor="#000000" cellspacing=“0” cellpadding=“5” width=“100%”>
<tr>
<th align=“center” width=“20%”>Imagem</th>
<th align=“center” width=“27%”>Nome</th>
<th align=“center” width=“15%”>Preço</th>
<th align=“center” width=“15%”>Quantidade</th>
<th align=“center” width=“15%”>Preço Total</th>
<th align=“center” width=“8%”>Remover</th>
</tr>
<!-- LISTAGEM DE PRODUTOS -->
<logic:iterate id=“item” scope=“session” name=“carrinho” property=“itensCarrinho”>
<tr>
<td align=“center” width=“20%”><image src=’<bean:write name=“item” property=“imagem”/>’ height=“60” ></td>
<td align=“center” width=“27%”><bean:write name=“item” property=“nome”/></td>
<td align=“center” width=“15%”>R$ <bean:write name=“item” property=“preco”/></td>
<td align=“center” width=“15%”><input type=“text” size=3 name=‘quant<bean:write name=“item” property=“produtoId”/>’ value=’<bean:write name=“item” property=“quantidade”/>’></td>
<td align=“center” width=“15%”>R$ <bean:write name=“item” property=“precoItemTotal”/></td>
<td align=“center” width=“8%”><html:link page="/carrinho.do?method=remover" paramName=“item” paramId=“id” paramProperty=“produtoId”>remover</html:link></td>
</tr>
</logic:iterate>
<tr>
<th colspan=“5” align=“right”><b>Total do Carrinho:</b></th>
<td colspan=“2” align=“center” width=“3%”> R$ <bean:write name=“carrinho” property=“precoTotal”/></td>
</tr>
</table>
<br>
<center>
<input type=“button” value=“Voltar” onClick=“javascript:document.location=‘catalogo.do’”>
<input type=“submit” value=“Atualizar”>
<input type=“button” value=“Limpar” onClick=“javascript:document.location=‘carrinho.do?method=limparCarrinho’”>
</center>
</form>
</logic:greaterThan>
<logic:lessEqual scope=“session” name=“carrinho” property=“tamanho” value=“0”>
<br><h3>Seu carrinho está vazio.</h3>
<br><input type=“button” value=“Voltar” onClick=“javascript:document.location=‘catalogo.do’”>
</logic:lessEqual>
</body>
</html:html>
--------------------- Fim carrinho.jsp--------------------------
---------------------catalogo.jsp--------------------------
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix=“logic”%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix=“bean”%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix=“html”%>
<html:html>
<head>
<title>Catálogo de Produtos</title>
<html:base/>
</head>
<body>
<h2 align=“center”>Catálogo de Produtos</h2>
<center><b>Escolha o produto desejado na lista abaixo. Boas compras!</b></center>
<br><br>
<table border=“0” cellspacing=“5” cellpadding=“1” width=“100%”>
<logic:iterate id=“produto” name=“catalogo”>
<tr><td colspan=“3”><hr></td></tr>
<tr>
<td width=“30%”><img ></td>
<td width=“50%”>
<table border=“0” cellpadding=“5”>
<tr>
<td colspan=“2” align=“center”><font size=“5px”><b><bean:write name=“produto” property=“nome” /></b></font></td>
</tr>
<tr>
<td valign=“top”><b>Descrição:</b></td>
<td><bean:write name=“produto” property=“descricao” /></td>
</tr>
<tr>
<td><b>Preço:</b></td>
<td>R$ <bean:write name=“produto” property=“preco” /></td>
</tr>
</table>
</td>
<td align=“center”>
<html:link page="/carrinho.do?method=adicionarItem" paramName=“produto” paramId=“id” paramProperty=“produtoId”>
<image src=“imagens/carrinho.jpg” height=“40” border=“0”>
</html:link>
</td>
</tr>
</logic:iterate>
<tr>
<td colspan=“3”><hr></td>
</tr>
</table>
<br><br>
<center>
<input type=“button” value=“Carrinho” onClick=“javascript:document.location=‘carrinho.do?method=visualizar’”>
</center>
</body>
</html:html>
------------------------Fim catalogo.jsp----------------------------
-----------------------index.jsp------------------------------
<HTML>
<HEAD><TITLE>Loja</TITLE></HEAD>
<BODY BGCOLOR=“White”>
<H1 ALIGN=“CENTER”>Escolha</H1>
<UL>
<LI><A >Carrinho</A>
</UL>
<UL>
<LI><A >Catalogo</A>
</UL>
</BODY>
</HTML>
-----------------------fim index.jsp----------------------------
------------------------struts-config.xml-----------------------
<?xml version=“1.0” encoding=“ISO-8859-1” ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
“http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd”>
<struts-config>
<!-- ====================================== Definicao de Form Beans -->
<form-beans>
</form-beans>
<!-- =============================== Definicoes de Excecoes Globais -->
<global-exceptions>
</global-exceptions>
<!-- =================================== Definicoes de Global Forward -->
<global-forwards>
<forward
name=“bemvindo"
path=”/catalogo.do"/>
</global-forwards>
<!-- ========================================== Mapeamento de Acoes -->
<action-mappings>
<!-- ACOES DA LISTAGEM DO CATALOGO DE PRODUTOS -->
<action path="/catalogo" type=“acoes.CatalogoAction”>
<forward name=“sucesso” path="/catalogo.jsp" />
</action>
<!-- ACOES DO CARRINHO DE COMPRAS -->
<action path="/carrinho"
type="acoes.CarrinhoComprasAction"
scope=“request"
input=”/carrinho.jsp"
validate="false"
parameter=“method”>
<forward name=“sucesso” path="/carrinho.jsp" />
</action>
</action-mappings>
<!-- ================================= Configuracoes do Controlador -->
<!-- ============================= Configuracao do Message Resouce -->
<message-resources parameter=“resources.ApplicationResources” />
<!-- ====================================== Configuracao de Plug-Ins -->
</struts-config>
-------------------------------fim struts-config.xml----------
****************Erro ao clickar em Carrinho n index.jsp
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: No bean found under attribute key carrinho
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
root cause
javax.servlet.ServletException: No bean found under attribute key carrinho
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.carrinho_jsp._jspService(carrinho_jsp.java:242)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
root cause
javax.servlet.jsp.JspException: No bean found under attribute key carrinho
org.apache.struts.taglib.logic.CompareTagBase.condition(CompareTagBase.java:221)
org.apache.struts.taglib.logic.GreaterThanTag.condition(GreaterThanTag.java:90)
org.apache.struts.taglib.logic.ConditionalTagBase.doStartTag(ConditionalTagBase.java:218)
org.apache.jsp.carrinho_jsp._jspService(carrinho_jsp.java:111)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
Apache Tomcat/5.5.17
*************Erro ao clicar em catalogo no index.jsp
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Cannot find bean catalogo in any scope
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
root cause
javax.servlet.ServletException: Cannot find bean catalogo in any scope
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
org.apache.jsp.catalogo_jsp._jspService(catalogo_jsp.java:193)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
root cause
javax.servlet.jsp.JspException: Cannot find bean catalogo in any scope
org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:877)
org.apache.struts.taglib.logic.IterateTag.doStartTag(IterateTag.java:277)
org.apache.jsp.catalogo_jsp._jspService(catalogo_jsp.java:104)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
Apache Tomcat/5.5.17
Desde já grato pela atenção;