日期:2014-05-18  浏览次数:20687 次

求助:HTTP Status 500
运行JSP+JAVABEAN在tomcat下出现这个问题
谁帮我看看
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: 25 in the jsp file: /bookstore/catalog.jsp
BookBean cannot be resolved to a type
22: <%
23: while(it.hasNext())
24: {
25: BookBean book=(BookBean)it.next();
26: String title=book.getTitle();
27: float price=book.getPrice();
28: int bookId=book.getId(); 


An error occurred at line: 25 in the jsp file: /bookstore/catalog.jsp
BookBean cannot be resolved to a type
22: <%
23: while(it.hasNext())
24: {
25: BookBean book=(BookBean)it.next();
26: String title=book.getTitle();
27: float price=book.getPrice();
28: int bookId=book.getId(); 


Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.23 logs.


------解决方案--------------------
你是不是忘了导入BookBean类了?
<%@ page import="....BookBean"%>
------解决方案--------------------
BookBean cannot be resolved to a type 就表示找不到这个包

------解决方案--------------------
25: BookBean book=(BookBean)it.next(); 

BookBean不能被解析
------解决方案--------------------
前面都说了。。 可能是没导类
我的异常网推荐解决方案:The server encountered an internal error () that prevented it from fulfilling this request.,http://www.aiyiweb.com/java-web/317.html
我的异常网推荐解决方案:org.apache.jasper.JasperException: Unable to compile class,http://www.aiyiweb.com/j2ee/2308.html