当前位置: 技术问答>java相关
jsp中的class到底该放哪里呀?我怎么一直报这个错?
来源: 互联网 发布时间:2015-11-08
本文导语: A Servlet Exception Has Occurred org.apache.jasper.JasperException: Unable to compile class for JSP..work192.168.0.1jsp_0002fjspaccessbbs_0002fabout_0002ejspabout_jsp_0.java:101: Class test.bbsuser not found. test.bbsuser user = null; ...
A Servlet Exception Has Occurred
org.apache.jasper.JasperException: Unable to compile class for JSP..work192.168.0.1jsp_0002fjspaccessbbs_0002fabout_0002ejspabout_jsp_0.java:101: Class test.bbsuser not found.
test.bbsuser user = null;
^
..work192.168.0.1jsp_0002fjspaccessbbs_0002fabout_0002ejspabout_jsp_0.java:104: Class test.bbsuser not found.
user= (test.bbsuser)
^
..work192.168.0.1jsp_0002fjspaccessbbs_0002fabout_0002ejspabout_jsp_0.java:109: Class test.bbsuser not found.
user = (test.bbsuser) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "test.bbsuser");
^
..work192.168.0.1jsp_0002fjspaccessbbs_0002fabout_0002ejspabout_jsp_0.java:126: Class test.bbsboard not found.
test.bbsboard board = null;
^
..work192.168.0.1jsp_0002fjspaccessbbs_0002fabout_0002ejspabout_jsp_0.java:129: Class test.bbsboard not found.
board= (test.bbsboard)
^
..work192.168.0.1jsp_0002fjspaccessbbs_0002fabout_0002ejspabout_jsp_0.java:134: Class test.bbsboard not found.
board = (test.bbsboard) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "test.bbsboard");
^
6 errors
at org.apache.jasper.compiler.Compiler.compile(Compiler.java, Compiled Code)
at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:478)
at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:449)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:159)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:171)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:328)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java, Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:251)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java, Compiled Code)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:196)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java, Compiled Code)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java, Compiled Code)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java, Compiled Code)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java, Compiled Code)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:159)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java, Compiled Code)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java, Compiled Code)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java, Compiled Code)
at java.lang.Thread.run(Thread.java:479)
org.apache.jasper.JasperException: Unable to compile class for JSP..work192.168.0.1jsp_0002fjspaccessbbs_0002fabout_0002ejspabout_jsp_0.java:101: Class test.bbsuser not found.
test.bbsuser user = null;
^
..work192.168.0.1jsp_0002fjspaccessbbs_0002fabout_0002ejspabout_jsp_0.java:104: Class test.bbsuser not found.
user= (test.bbsuser)
^
..work192.168.0.1jsp_0002fjspaccessbbs_0002fabout_0002ejspabout_jsp_0.java:109: Class test.bbsuser not found.
user = (test.bbsuser) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "test.bbsuser");
^
..work192.168.0.1jsp_0002fjspaccessbbs_0002fabout_0002ejspabout_jsp_0.java:126: Class test.bbsboard not found.
test.bbsboard board = null;
^
..work192.168.0.1jsp_0002fjspaccessbbs_0002fabout_0002ejspabout_jsp_0.java:129: Class test.bbsboard not found.
board= (test.bbsboard)
^
..work192.168.0.1jsp_0002fjspaccessbbs_0002fabout_0002ejspabout_jsp_0.java:134: Class test.bbsboard not found.
board = (test.bbsboard) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "test.bbsboard");
^
6 errors
at org.apache.jasper.compiler.Compiler.compile(Compiler.java, Compiled Code)
at org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:478)
at org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:449)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:159)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:171)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:328)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java, Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:251)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java, Compiled Code)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:196)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java, Compiled Code)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java, Compiled Code)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java, Compiled Code)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java, Compiled Code)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:159)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java, Compiled Code)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java, Compiled Code)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java, Compiled Code)
at java.lang.Thread.run(Thread.java:479)
|
如果你用的是4.x版本,就放在tomcat_home/common/classes/下
|
tomcatwebappsROOTWEB-INFclasses
|
如果有PACKAGE要建一个PACKAGE为名称的文件夹在jsp文件目录下/web-info/classes/你的package文件夹/*.class
|
如果你没有配置SERVER.XML
那么你的jsp文件要放在webapps/你的jsp文件夹名下
class就放在webapps/你的jsp文件夹名/web-info/classes/你的package文件夹/*.class
重新启动你的服务器!
那么你的jsp文件要放在webapps/你的jsp文件夹名下
class就放在webapps/你的jsp文件夹名/web-info/classes/你的package文件夹/*.class
重新启动你的服务器!
|
你的*.class里要有package 你的package才行
放才webapps/你的jsp文件夹名/web-info/classes/你的package文件夹
需要重新启动你的服务器!
放才webapps/你的jsp文件夹名/web-info/classes/你的package文件夹
需要重新启动你的服务器!