jsp:useBean 问题
在看轻量级JavaEE 开发,顺手练了下面这个例子。结果出错,搞了一个晚上都没搞定。我伤不起啊。求大神指导。我以前做C++开发的,突然想看看java web开发。结果配置问题搞死了。。哎。。
<!-- if use default package, just need to specific class name -->
<jsp:useBean class="com.web01.jsp.Person" id="peo" scope="session" />
<jsp:setProperty name="peo" property="name" value="chcucl" />
<jsp:setProperty name="peo" property="age" value="28" />
<jsp:getProperty name="peo" property="name" /> <br/>
<jsp:getProperty name="peo" property="age" />
HTTP Status 500 - /WebContent/jsp01.jsp (line: 28, column: 4) The value for the useBean class attribute com.web01.jsp.Person is invalid.
type Exception report
message /WebContent/jsp01.jsp (line: 28, column: 4) The value for the useBean class attribute com.web01.jsp.Person is invalid.
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /WebContent/jsp01.jsp (line: 28, column: 4) The value for the useBean class attribute com.web01.jsp.Person is invalid.
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:276)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:108)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1241)
org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1163)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2359)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417)
org.apache.jasper.compiler.Node$Root.accept(Node.java:464)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2359)
org.apache.jasper.compiler.Generator.generate(Generator.java:3515)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:250)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:606)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:403)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:347)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:277)
org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:274)