Hi Lakshmi, Try putting the Bean Class (UserData) in WEB-INF\classes directory and make sure it is in the classpath. Also, if you are using 'Tomcat 5', the bean class has to be inside a package.
You have to import only packages. For example, in JSP, you can no longer have <%@page import="someClass"%>. It has to be inside a package. You can only have <%@page import ="somePckg.someClass" %> Otherwise, it'll give exception "."expected
description The server encountered an internal error () that prevented it from fulfilling this request.
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 1 in the jsp file: /SaveNam.jsp Generated servlet error: C:\jakarta-tomcat-5.0.28\work\Catalina\localhost\_\org\apache\jsp\SaveNam_jsp.java:42: cannot access org.apache.jsp.UserData
An error occurred at line: 1 in the jsp file: /SaveNam.jsp Generated servlet error: bad class file: C:\jakarta-tomcat-5.0.28\webapps\ROOT\WEB-INF\classes\org\apache\jsp\UserData.class class file contains wrong class: UserData Please remove or make sure it appears in the correct subdirectory of the classpath. UserData user = null; ^ 1 error
Put the UserData inside a package, say "myPack" and put this inside the /WEB-INF/classes folder. In your JSP pages, import the package itself - <jsp:useBean id="user" class="myPack.UserData" scope="session"/> Please check your JSP page for any errors!! Let me know if you have any problems.
I just tried it out and it seems to be working properly. Maybe you have some problem in classpath. Just check if you have the WEB-INF/classes folder in the correct path. Also this bean file inside WEB-INF/classes/myPack/UserData.class. Check for the correct package name too. I found a link where someone had the same problem. Hope it solves yours too!! http://forums.devshed.com/t44539/s.html Let me know if you have more problems.