Estou com um erro quando estou tentando usar um javabean. tenho um html que “chama” um arquivo jsp conforme abaixo:
<%@page import="recursos.*" %>
<jsp:useBean class="recursos.Cesta" id="minhaCesta" scope="session"/>
<%
if(request.getParameter("acao").equals("add"))
{
String descr=request.getParameter("Pizza");
String tam=request.getParameter("Tamanho");
float pr=Float.parseFloat(request.getParameter("Preco"));
minhaCesta.adicionarPizza(descr,tam,pr);
}
else if(request.getParameter("acao").equals("del"))
{
int indice=Integer.parseInt(request.getParameter("Indice"));
}
float total=0;
%>
<html>
<head>
<title> Pizzaria</title>
</head>
<body>
Quando executo este arquivo através da página html me dá o seguinte erro.
[list]type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /projeto/jsp/cesta.jsp(2,0) The value for the useBean class attribute recursos.Cesta is invalid.
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1223)
org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Generator.generate(Generator.java:3268)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:189)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:296)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.7 logs.
[/list]
Já inseri o arquivo Cesta.java (meu bean) dentro das seguintes pastas
ROOT/projeto/jsp/recursos/Cesta.jsp
ROOT/projeto/jsp/WEB-INF/recursos/Cesta.jsp
ROOT/projeto/WEB-INF/recursos/Cesta.jsp
e até agora não deu certo, onde exatamente tenho que colocar o arquivo Cesta.jsp?
Me parece que ele não encontra o arquivo, ou tem algima coisa errada no código[/code]
