title: Exception in JSP usebean
body: <p>I've been working with JSP <code>usebean</code>, when I am trying to use bean in JSP, its throwing an exception that "<strong>It cannot find the class</strong>". But I've followed the correct structure, I assume, and included everything required. Please go through the code and let me know what could be the problem.</p>
  
  <pre><code>//init.jsp
  --------
  &lt;%@ page import="com.wipro.upload.extract.EmployeeDetailsExtract" %&gt;
  &lt;%@ page import="com.wipro.upload.extract.ColumnDetailsExtract" %&gt;
  &lt;%@ page import="com.wipro.upload.extract.dto.Employee" %&gt;
  &lt;%@ page import="com.wipro.upload.bean.Data" %&gt;
  &lt;jsp:useBean id="detailsbean" class="com.wipro.upload.bean.Data" scope="session" /&gt;
  &lt;jsp:setProperty name="detailsbean" property="*" /&gt;
  &lt;%
   detailsbean.setValues(new EmployeeDetailsExtract("c:\\new.xls").employeeListExtracter());
   List list=detailsbean.getValues();
  
   Iterator itr=list.iterator();
   while(itr.hasNext())
   {
    Employee emp=(Employee)itr.next();
    out.println(emp.employeeName);
   }
  %&gt;
  </code></pre>
  
  <hr>
  
  <pre><code>// Data.java
  package com.wipro.upload.bean;
  import java.util.*;
  public class Data
  {
   private List column;
   private List values;
   public Data()
   {
   }
   public void setColumn(List column)
   {
    this.column=column;
   }
  
   public List getColumn()
   {
    return column;
   }
   public void setValues(List values)
   {
    this.values=values;
   }
   public List getValues(List values)
   {
    return values;
   }
  }
  </code></pre>
  
  <hr>
  
  <p><strong>The error occuring while trying to execute the above code is,</strong></p>
  
  <pre><code>org.apache.jasper.JasperException: /init.jsp(6,0) The value for the useBean class attribute com.wipro.upload.bean.Data 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:1272)
      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:3426)
      org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:216)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:332)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
      org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
      org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  </code></pre>