一不放包中就出错
tomcat5+jdk1.42
有规定说必须放包中没?
错误如下:
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 14 in the jsp file: /useBeanJsp.jsp
Generated servlet error:
[javac] Compiling 1 source file
D:\tomcat-jwsdp-1.4\work\Catalina\localhost\dbBeen\org\apache\jsp\useBeanJsp_jsp.java:58: cannot resolve symbol
symbol : class dbBean
location: class org.apache.jsp.useBeanJsp_jsp
dbBean dbBean = null;
^
An error occurred at line: 14 in the jsp file: /useBeanJsp.jsp
Generated servlet error:
D:\tomcat-jwsdp-1.4\work\Catalina\localhost\dbBeen\org\apache\jsp\useBeanJsp_jsp.java:60: cannot resolve symbol
symbol : class dbBean
location: class org.apache.jsp.useBeanJsp_jsp
dbBean = (dbBean) _jspx_page_context.getAttribute("dbBean", PageContext.SESSION_SCOPE);
^
An error occurred at line: 14 in the jsp file: /useBeanJsp.jsp
Generated servlet error:
D:\tomcat-jwsdp-1.4\work\Catalina\localhost\dbBeen\org\apache\jsp\useBeanJsp_jsp.java:62: cannot resolve symbol
symbol : class dbBean
location: class org.apache.jsp.useBeanJsp_jsp
dbBean = new dbBean();
^
3 errors
7 个解决方案
#1
你最好放在包中,好像JSP中引用的對象必須是有package的
#2
你把代码改一下, 不必都放在包里.
#3
应该放包里吧 。
关注一下
关注一下
#4
我改了,然后就出现上面得错误!
只要没放在包中就错,郁闷死了1
只要没放在包中就错,郁闷死了1
#5
是你代码的问题。可以不用打包
#6
最好是package一下,否则需要在页面中import该bean类
#7
楼主,我测试了,好像是这样的,但书上没这规定啊,谁来给个权威解释!
#1
你最好放在包中,好像JSP中引用的對象必須是有package的
#2
你把代码改一下, 不必都放在包里.
#3
应该放包里吧 。
关注一下
关注一下
#4
我改了,然后就出现上面得错误!
只要没放在包中就错,郁闷死了1
只要没放在包中就错,郁闷死了1
#5
是你代码的问题。可以不用打包
#6
最好是package一下,否则需要在页面中import该bean类
#7
楼主,我测试了,好像是这样的,但书上没这规定啊,谁来给个权威解释!