显示的错误是: type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: Unable to compile class for JSPAn error occurred at line: 4 in the jsp file: /725/test.jspGenerated servlet error: [javac] Compiling 1 source fileD:\Tomcat\work\Standalone\localhost\_\725\test_jsp.java:7: cannot find symbol symbol : class TestBean location: package test import test.TestBean; ^ D:\Tomcat\work\Standalone\localhost\_\725\test_jsp.java:47: cannot find symbol symbol : class TestBean location: class org.apache.jsp.test_jsp TestBean testBean=new TestBean("This is a test java bean."); ^An error occurred at line: 4 in the jsp file: /725/test.jspGenerated servlet error: D:\Tomcat\work\Standalone\localhost\_\725\test_jsp.java:47: cannot find symbol symbol : class TestBean location: class org.apache.jsp.test_jsp TestBean testBean=new TestBean("This is a test java bean."); ^ 3 errors
我是用netbean3.6工具的,方法是在webimf目录>>class目录,在class目录中new一个package,你的包名为test,然后把TestBeab在test包里(目录下),在jsp中: <jsp:userbean id ="testBean" scope="application" class ="test.TestBean"/>. 我测试过没问题.
type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: Unable to compile class for JSPAn error occurred at line: 4 in the jsp file: /725/test.jspGenerated servlet error:
[javac] Compiling 1 source fileD:\Tomcat\work\Standalone\localhost\_\725\test_jsp.java:7: cannot find symbol
symbol : class TestBean
location: package test
import test.TestBean;
^
D:\Tomcat\work\Standalone\localhost\_\725\test_jsp.java:47: cannot find symbol
symbol : class TestBean
location: class org.apache.jsp.test_jsp
TestBean testBean=new TestBean("This is a test java bean.");
^An error occurred at line: 4 in the jsp file: /725/test.jspGenerated servlet error:
D:\Tomcat\work\Standalone\localhost\_\725\test_jsp.java:47: cannot find symbol
symbol : class TestBean
location: class org.apache.jsp.test_jsp
TestBean testBean=new TestBean("This is a test java bean.");
^
3 errors
创建一个文件夹test,把TestBean放在test目录下
<jsp:userbean id ="testBean" scope="application" class ="test.TestBean"/>.
我测试过没问题.
看一下行不行呀!不行你把代码考过来我帮你调试!
对了你在公司工作的吗?
好好看看把 对包的概念好象不太清晰