• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

can not load beanclass

 
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well i have putted bean class in the web-inf\classes folder
and page.jsp in c:\tomcat\webapps\examples
but still it is giving error.Please tell i have spend a lot of time but i can't get.
Page.jsp:
<html>
<head><title>Page Directive</title></head>
<body>
<%@page language="java"%>
<jsp:useBean id="name" scope="page" class="TestBean"/>
</body>
</html>

import java.beans.*;
public class TestBean
{
private int val;
public void set(int i){
this.val=i;
}
public int get(){
return val;
}
}
Giving following error..
:\tomcat4\work\localhost\examples\Page$jsp.java:64: Class org.apache.jsp.TestBean not found.
TestBean name = null;
^
An error occurred at line: 6 in the jsp file: /Page.jsp
Generated servlet error:
C:\tomcat4\work\localhost\examples\Page$jsp.java:67: Class org.apache.jsp.TestBean not found.
name= (TestBean)
^
An error occurred at line: 6 in the jsp file: /Page.jsp
Generated servlet error:
C:\tomcat4\work\localhost\examples\Page$jsp.java:72: Class org.apache.jsp.TestBean not found.
name = (TestBean) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "TestBean");
^
 
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
try to add a package declaration to your class, I�ve seen bugs in some versions of Tomcat and this was one of them(couldn�t find classes without package declaration).
 
reply
    Bookmark Topic Watch Topic
  • New Topic