段
段维
Unregistered / Unconfirmed
GUEST, unregistred user!
我用的是TomCat3.1
按照yysun老师的例子学习时,别的都没什么异常。
可是就是调用不了JavaBean,
具体情况是这样的:
我将hi_bean.jsp保存在
d:/tom/jakarta-tomcat/webapps/examples/jsp/tuorial
(d:/tom/jakarta-tomcat/ 是TomCat的安装路径)
将helloWorld.java 编译后将helloWorld.class复制到
d:/tom/jakarta-tomcat/webapps/examples/WEB-INF/jsp/beans/test
之后在浏览器中地址栏中键入
http://127.0.0.1:8080/examples/jsp/tutorial/hellouser/hi_bean.jsp
得到以下结果:
Location: /examples/jsp/tutorial/hellouser/hi_bean.jsp
Internal Servlet Error:
org.apache.jasper.JasperException: Unable to compile class for JSPD:/tom/jakarta-tomcat/work/localhost_8080%2Fexamples/_0002fjsp_0002ftutorial_0002fhellouser_0002fhi_0005fbean_0002ejsphi_0005fbean_jsp_1.java:63: Class test.helloWorld not found.
test.helloWorld helloBean = null;
^
D:/tom/jakarta-tomcat/work/localhost_8080%2Fexamples/_0002fjsp_0002ftutorial_0002fhellouser_0002fhi_0005fbean_0002ejsphi_0005fbean_jsp_1.java:66: Class test.helloWorld not found.
helloBean= (test.helloWorld)
^
D:/tom/jakarta-tomcat/work/localhost_8080%2Fexamples/_0002fjsp_0002ftutorial_0002fhellouser_0002fhi_0005fbean_0002ejsphi_0005fbean_jsp_1.java:71: Class test.helloWorld not found.
helloBean = (test.helloWorld) Beans.instantiate(getClassLoader(), "test.helloWorld");
^
3 errors
at org.apache.jasper.compiler.Compiler.compile(Compiler.java, Compiled Code)
at org.apache.jasper.runtime.JspServlet.loadJSP(JspServlet.java:413)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:149)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:161)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java, Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java, Compiled Code)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java, Compiled Code)
at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java, Compiled Code)
at java.lang.Thread.run(Thread.java:479)
怎么办啊!!!我试了别的调用JavaBean的例子也都不行。
按照yysun老师的例子学习时,别的都没什么异常。
可是就是调用不了JavaBean,
具体情况是这样的:
我将hi_bean.jsp保存在
d:/tom/jakarta-tomcat/webapps/examples/jsp/tuorial
(d:/tom/jakarta-tomcat/ 是TomCat的安装路径)
将helloWorld.java 编译后将helloWorld.class复制到
d:/tom/jakarta-tomcat/webapps/examples/WEB-INF/jsp/beans/test
之后在浏览器中地址栏中键入
http://127.0.0.1:8080/examples/jsp/tutorial/hellouser/hi_bean.jsp
得到以下结果:
Location: /examples/jsp/tutorial/hellouser/hi_bean.jsp
Internal Servlet Error:
org.apache.jasper.JasperException: Unable to compile class for JSPD:/tom/jakarta-tomcat/work/localhost_8080%2Fexamples/_0002fjsp_0002ftutorial_0002fhellouser_0002fhi_0005fbean_0002ejsphi_0005fbean_jsp_1.java:63: Class test.helloWorld not found.
test.helloWorld helloBean = null;
^
D:/tom/jakarta-tomcat/work/localhost_8080%2Fexamples/_0002fjsp_0002ftutorial_0002fhellouser_0002fhi_0005fbean_0002ejsphi_0005fbean_jsp_1.java:66: Class test.helloWorld not found.
helloBean= (test.helloWorld)
^
D:/tom/jakarta-tomcat/work/localhost_8080%2Fexamples/_0002fjsp_0002ftutorial_0002fhellouser_0002fhi_0005fbean_0002ejsphi_0005fbean_jsp_1.java:71: Class test.helloWorld not found.
helloBean = (test.helloWorld) Beans.instantiate(getClassLoader(), "test.helloWorld");
^
3 errors
at org.apache.jasper.compiler.Compiler.compile(Compiler.java, Compiled Code)
at org.apache.jasper.runtime.JspServlet.loadJSP(JspServlet.java:413)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:149)
at org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.java:161)
at org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)
at org.apache.jasper.runtime.JspServlet.service(JspServlet.java, Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java, Compiled Code)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:559)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java, Compiled Code)
at org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java, Compiled Code)
at java.lang.Thread.run(Thread.java:479)
怎么办啊!!!我试了别的调用JavaBean的例子也都不行。