Sou iniciante em java e estou fazendo uns teste aqui
fiz umas classes em java e rodou legal…
então comecei a utilizar as mesmas classes para fazer algo em JSP
mas aconteceu o seguinte erro e não estou conseguindo descobrir o erro
esse é o codigo:
lista-scriptlet.jsp
<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@page import="java.util.*,br.com.caelum.jdbc.*,br.com.caelum.jdbc.dao.*,br.com.caelum.jdbc.modelo.*" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title></title>
</head>
<body>
<ul>
<%
ContatoDAO dao = new ContatoDAO();
List<Contato> contatos = dao.getLista();
for(Contato contato : contatos){
%>
<li><%=contato.getNome() %>, <%=contato.getEmail() %></li>
<% } %>
</ul>
</body>
</html>
esse é o erro:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 11 in the jsp file: /web/lista-scriptlet.jsp
ContatoDAO cannot be resolved to a type
8: <body>
9: <ul>
10: <%
11: ContatoDAO dao = new ContatoDAO();
12: List<Contato> contatos = dao.getLista();
13:
14: for(Contato contato : contatos){
An error occurred at line: 11 in the jsp file: /web/lista-scriptlet.jsp
ContatoDAO cannot be resolved to a type
8: <body>
9: <ul>
10: <%
11: ContatoDAO dao = new ContatoDAO();
12: List<Contato> contatos = dao.getLista();
13:
14: for(Contato contato : contatos){
An error occurred at line: 12 in the jsp file: /web/lista-scriptlet.jsp
Contato cannot be resolved to a type
9: <ul>
10: <%
11: ContatoDAO dao = new ContatoDAO();
12: List<Contato> contatos = dao.getLista();
13:
14: for(Contato contato : contatos){
15: %>
An error occurred at line: 14 in the jsp file: /web/lista-scriptlet.jsp
Contato cannot be resolved to a type
11: ContatoDAO dao = new ContatoDAO();
12: List<Contato> contatos = dao.getLista();
13:
14: for(Contato contato : contatos){
15: %>
16: <li><%=contato.getNome() %>, <%=contato.getEmail() %></li>
17: <% } %>
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 11 in the jsp file: /web/lista-scriptlet.jsp
ContatoDAO cannot be resolved to a type
8: <body>
9: <ul>
10: <%
11: ContatoDAO dao = new ContatoDAO();
12: List<Contato> contatos = dao.getLista();
13:
14: for(Contato contato : contatos){
An error occurred at line: 11 in the jsp file: /web/lista-scriptlet.jsp
ContatoDAO cannot be resolved to a type
8: <body>
9: <ul>
10: <%
11: ContatoDAO dao = new ContatoDAO();
12: List<Contato> contatos = dao.getLista();
13:
14: for(Contato contato : contatos){
An error occurred at line: 12 in the jsp file: /web/lista-scriptlet.jsp
Contato cannot be resolved to a type
9: <ul>
10: <%
11: ContatoDAO dao = new ContatoDAO();
12: List<Contato> contatos = dao.getLista();
13:
14: for(Contato contato : contatos){
15: %>
An error occurred at line: 14 in the jsp file: /web/lista-scriptlet.jsp
Contato cannot be resolved to a type
11: ContatoDAO dao = new ContatoDAO();
12: List<Contato> contatos = dao.getLista();
13:
14: for(Contato contato : contatos){
15: %>
16: <li><%=contato.getNome() %>, <%=contato.getEmail() %></li>
17: <% } %>
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
alguem tem ideia do q pode ser
obrigado