The value for the useBean class attribute com.wrox.library.Book is invalid
I have created the simple bean class (Book.java) and placed it under C:\Tomcat 6.0\webapps\ch03\web-inf\Classes\com\wrox\library directory. My java class looks like below,
package com.wrox.library;
public class Book{
private String title;
public Book(){
}
public void setTitle(String title){
this.title=title;
}
public String getTitle(){
return this.title;
}
}
and i have a simple jsp page
<html><head><title>A simple class</title></head>
<body>
<jsp:useBean id="myBook" class="com.wrox.library.Book" scope="session"/>
<jsp:setProperty name="myBook" property="title" value="Begging Jsp Web Development"/>
Book Title::<jsp:getProperty name="myBook" property="title"/>
</body></html>
But when try to run the jsp using my tomcat six it is giving the error:
org.apache.jasper.JasperException: /t1.jsp(3,0) The value for the useBean class attribute com.wrox.library.Book 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:1155)
I have tried with specifying the class name in type attribute but it didnt work for me.
Please help me out to solve this problem.
Thanks in advance.
Sumanth

