当前位置: 代码迷 >> Java Web开发 >> 找不到bean(The value for the useBean class attribute test.acceptPara is invalid),该怎么处理
  详细解决方案

找不到bean(The value for the useBean class attribute test.acceptPara is invalid),该怎么处理

热度:334   发布时间:2016-04-17 16:19:04.0
找不到bean(The value for the useBean class attribute test.acceptPara is invalid)
报错:
org.apache.jasper.JasperException:   /wlxy_1/web/acceptPara.jsp(4,0)   The   value   for   the   useBean   class   attribute   test.acceptPara   is   invalid.
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:150)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1227)
org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
org.apache.jasper.compiler.Generator.generate(Generator.java:3272)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:244)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

JSP   页面1:
---------------------------
<form   method= "POST "   action= "acceptPara.jsp ">
        <p   align= "center ">
    姓   名: <input   type= "text "   name= "name "   size= "20 "> <br>  
        年   龄:&nbsp;&nbsp;&nbsp;   <input   type= "text "   name= "age "   size= "15 "> <br>  
        性   别:&nbsp;&nbsp;&nbsp;   <input   type= "radio "   value= "male "   checked   name= "sex ">
        男&nbsp;&nbsp;&nbsp;&nbsp; <input   type= "radio "   name= "sex "   value= "female ">
        女 </p>  
        <p   align= "center ">
      <input   type= "submit "   value= "submit "   name= "submit ">  
          <input   type= "reset "   value= "reset "   name= "reset "> </p>  
  </form>  

页面2:
acceptPara.jsp
-----------------------------------------------------
<%@   page   language= "java "   errorPage= "error.jsp "   %>
<html>
<%@   page   import= "test.acceptPara "   contentType= "text/html;charset=gb2312 "%>
<jsp:useBean   id= "atest "   class= "test.acceptPara "/>
<head> <title> acceptPara.jsp </title> </head>
<body>
<jsp:setProperty   name= "atest "   property= "* "/>
  相关解决方案