改成这样, <%@ page contentType="text/html;charset=gb2312" import="tt.item,tt.Cart"%> 还是会报错呀!!!org.apache.jasper.JasperException: Unable to compile class for JSPAn error occurred at line: -1 in the jsp file: nullGenerated servlet error: [javac] Since fork is true, ignoring compiler setting. [javac] Compiling 1 source file [javac] Since fork is true, ignoring compiler setting. [javac] D:\tomcat\work\Catalina\localhost\_\org\apache\jsp\softshop\indexcontent_jsp.java:6: cannot access tt.item [javac] bad class file: D:\tomcat\webapps\ROOT\WEB-INF\classes\tt\item.class [javac] class file contains wrong class: item [javac] Please remove or make sure it appears in the correct subdirectory of the classpath. [javac] import tt.item; [javac] ^ [javac] 1 error
bean文件里面写没写~import item.*;~import Cart.*;
WEB-INF是被禁止访问的吧,只有BEAN才行
to 7758akuma(阿酷玛) 我没有用到usebean
在被包含页中不要再设置contentType; <%@page import="tt.*"%>
在被包含页中不要再设置contentType; <%@page import="tt.*"%> 这样改了后,打开indexcontent.jsp时还是报错如下,可明明Cart类用 javac命令编译没有问题的呀!!!!!!!!!!!!!!!各位,帮忙呀 org.apache.jasper.JasperException: Unable to compile class for JSPAn error occurred at line: -1 in the jsp file: nullGenerated servlet error: [javac] Since fork is true, ignoring compiler setting. [javac] Compiling 1 source file [javac] Since fork is true, ignoring compiler setting. [javac] D:\tomcat\work\Catalina\localhost\_\org\apache\jsp\softshop\indexcontent_jsp.java:53: cannot access tt.Cart [javac] bad class file: D:\tomcat\webapps\ROOT\WEB-INF\classes\tt\Cart.class [javac] class file contains wrong class: Cart [javac] Please remove or make sure it appears in the correct subdirectory of the classpath. [javac] Cart ShopCart=(Cart)session.getAttribute("cart"); [javac] ^ [javac] 1 error
<%@ page contentType="text/html;charset=gb2312" import="tt.item,tt.Cart"%>
还是会报错呀!!!org.apache.jasper.JasperException: Unable to compile class for JSPAn error occurred at line: -1 in the jsp file: nullGenerated servlet error:
[javac] Since fork is true, ignoring compiler setting.
[javac] Compiling 1 source file
[javac] Since fork is true, ignoring compiler setting.
[javac] D:\tomcat\work\Catalina\localhost\_\org\apache\jsp\softshop\indexcontent_jsp.java:6: cannot access tt.item
[javac] bad class file: D:\tomcat\webapps\ROOT\WEB-INF\classes\tt\item.class
[javac] class file contains wrong class: item
[javac] Please remove or make sure it appears in the correct subdirectory of the classpath.
[javac] import tt.item;
[javac] ^
[javac] 1 error
我没有用到usebean
<%@page import="tt.*"%>
<%@page import="tt.*"%>
这样改了后,打开indexcontent.jsp时还是报错如下,可明明Cart类用
javac命令编译没有问题的呀!!!!!!!!!!!!!!!各位,帮忙呀
org.apache.jasper.JasperException: Unable to compile class for JSPAn error occurred at line: -1 in the jsp file: nullGenerated servlet error:
[javac] Since fork is true, ignoring compiler setting.
[javac] Compiling 1 source file
[javac] Since fork is true, ignoring compiler setting.
[javac] D:\tomcat\work\Catalina\localhost\_\org\apache\jsp\softshop\indexcontent_jsp.java:53: cannot access tt.Cart
[javac] bad class file: D:\tomcat\webapps\ROOT\WEB-INF\classes\tt\Cart.class
[javac] class file contains wrong class: Cart
[javac] Please remove or make sure it appears in the correct subdirectory of the classpath.
[javac] Cart ShopCart=(Cart)session.getAttribute("cart");
[javac] ^
[javac] 1 error
目录下,编译没有任何问题.
---------------------------------------------------
怀疑你的item,Cart两个类没有package tt;
你检查一下