我也有同样的问题。你回来教教我
exception org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 10 in the jsp file: /gst/index.jsp
DataSource cannot be resolved to a type
7:  <a href="say.html"></a><br>
8:  <%
9:  Context ctx=new InitialContext();
10:  DataSource ds=(DataSource)ctx.lookup("java:comp/env/jdbc/bookstore");
11:  Connection conn=ds.getConnection();
12:  Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
13:  ResultSet rs=stmt.executeQuery("select * from guestbook order by gst_time desc");
An error occurred at line: 10 in the jsp file: /gst/index.jsp
DataSource cannot be resolved to a type
7:  <a href="say.html"></a><br>
8:  <%
9:  Context ctx=new InitialContext();
10:  DataSource ds=(DataSource)ctx.lookup("java:comp/env/jdbc/bookstore");
11:  Connection conn=ds.getConnection();
12:  Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
13:  ResultSet rs=stmt.executeQuery("select * from guestbook order by gst_time desc");
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:317)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.