当前位置: 代码迷 >> Java Web开发 >> 初学jsp,碰到有关问题了,帮帮忙看下吧
  详细解决方案

初学jsp,碰到有关问题了,帮帮忙看下吧

热度:6309   发布时间:2013-02-25 21:19:00.0
初学jsp,碰到问题了,帮帮忙看下吧
初学jsp,碰到问题了,帮帮忙看下吧

HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: /WebRoot/index.jsp(24,0) The value for the useBean class attribute com.GoodsClass is invalid.
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1231)
org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1178)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
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:495)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
org.apache.jasper.compiler.Generator.generate(Generator.java:3442)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:231)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:347)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:592)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:326)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.32 logs.


------解决方案--------------------------------------------------------
<jsp:useBean id="goodsClass" class="com.GoodsClass" scope="page"/>
改成
<jsp:useBean id="goodsClass" class="com.GoodsClass" scope="session"/>
还有注意id和class值的大小写问题,看看有没有错 
你的GoodsClass类必须要有一个无参数的构造函数,希望对你有用。
  相关解决方案
本站暂不开放注册!
内测阶段只得通过邀请码进行注册!
 
  • 最近登录:Tue Oct 24 06:41:29 CST 2017
  • 最近登录:Tue Oct 24 06:41:29 CST 2017
  • 最近登录:Tue Oct 24 06:41:29 CST 2017
  • 最近登录:Tue Oct 24 06:41:29 CST 2017
  • 最近登录:Tue Oct 24 06:41:29 CST 2017