0 Replies Latest reply: Jan 14, 2010 3:59 AM by 801428 RSS

    The value for the useBean class attribute com.kogent.Student is invalid.

    801428
      Hello..
      experts...
      I am doing JavaBeans programming with the jsp but i got the following error

      org.apache.jasper.JasperException: /webproject/student.jsp(9,0) The value for the useBean class attribute com.kogent.Student 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:1200)
           org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1160)
           org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
           org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2393)
           org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2399)
           org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
           org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
           org.apache.jasper.compiler.Generator.generate(Generator.java:3372)
           org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)
           org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
           org.apache.jasper.compiler.Compiler.compile(Compiler.java:294)
           org.apache.jasper.compiler.Compiler.compile(Compiler.java:281)
           org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
           org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
           org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
           org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
           javax.servlet.http.HttpServlet.service(HttpServlet.java:803

      my jsp file is student.jsp
      <jsp:useBean id="student" class="com.kogent.Student" scope="session" />
      <form action="student_info.jsp" menthod="post">
      <table align="center">
      <tr><td colspan=2 align="center"><h4>Enter Student Detail</h4></td></tr>
      <tr><td> Roll No </td>
      <td><input type="text" name="rollno" value="<jsp:getProperty name="student" property="rollno"/>"></td></tr>
      <tr><td> Student Name </td>
      <td><input type="text" name="name" value="<jsp:getProperty name="student" property="name"/>"></td></tr>
      <tr><td> Course </td>
      <td><input type="text" name="course" value="<jsp:getProperty name="student" property="course"/>"></td></tr>
      <tr><td> City </td>
      <td><input type="text" name="city" value="<jsp:getProperty name="student" property="city"/>"></td></tr>
      my java file is Student.java
      package com.kogent;
      public class Student
      {
           int rollno;
           String name;
           String course;
           String city;
           public Student()
           {
                rollno=0;
                name="";
                course="";
                city="";
           }
           public String getCity()
           {
                return city;
           }
           public void setCity(String city)
           {
                this.city=city;
           }
           public String getCourse()
           {
                return course;
           }
           public void setCourse(String course)
           {
                this.course=course;
           }
                     public String getName()
           {
                return name;
           }
           public void setName(String name)
           {
                this.name=name;
           }
           public int getRollNo()
           {
                return rollno;
           }
           public void setRollNo(int rollno)
           {
                this.rollno=rollno;
           }
      }
      Please Help Me