主题:JSP中无法使用javabean,郁闷啊,谁来帮帮我,感激不尽!
我安装的是JDK5 和Tomcat5.5.在C:\Tomcat 5.5\webapps\ROOT\myapp中可以运行没有javabean的JSP程序.java小程序也可以在命令行下编译执行,可是当我把编译好的faq.java程序faq.class放在当前目录下,或者C:\Tomcat 5.5\webapps\ROOT\WEB-INF\classes目录下时,都无法正常执行,错误报告如下:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 9 in the jsp file: /faq.jsp
Generated servlet error:
faq cannot be resolved or is not a type
An error occurred at line: 9 in the jsp file: /faq.jsp
Generated servlet error:
faq cannot be resolved or is not a type
An error occurred at line: 9 in the jsp file: /faq.jsp
Generated servlet error:
faq cannot be resolved or is not a type
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
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:293)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
这里的第9行的JSP程序为:
<jsp:useBean id="workM" scope="page" class="faq"/>
我已经试了好多次了,谁来帮帮我啊,这里先谢谢了!!!
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 9 in the jsp file: /faq.jsp
Generated servlet error:
faq cannot be resolved or is not a type
An error occurred at line: 9 in the jsp file: /faq.jsp
Generated servlet error:
faq cannot be resolved or is not a type
An error occurred at line: 9 in the jsp file: /faq.jsp
Generated servlet error:
faq cannot be resolved or is not a type
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
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:293)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
这里的第9行的JSP程序为:
<jsp:useBean id="workM" scope="page" class="faq"/>
我已经试了好多次了,谁来帮帮我啊,这里先谢谢了!!!