• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp: useBean not finding Bean class plz help

 
amit shukla
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I'm using useBean tag to set and get a property of a bean ..i have copied the jar file into /lib of jws2.0 but it is not finding the Bean Class .. Please suggest what to do or verify
thanx
 
Ajan Balakrishnan
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add your bean class directory in your classpath
Personally i never use set and get Property instead i call the bean methods directly.
For your reference this is the syntax with a JSP calling the getData method of a Test bean class(inside package "myPackage")

FYI, "scope" can be anything depending on your requirements
Ajan

[This message has been edited by Ajan Balakrishnan (edited February 20, 2001).]
 
amit shukla
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx ajan .. but even after setting that in my class path i'm not able to retrieve that.. but i'm not using page directive with useBean is it reqd.i'm using the following code. i haven't serialized any instance all i have is Hello.jar which has HelloBean.class in it, in the classpath..
<html>
<body>
<jsp:useBean id="hello" class="HelloBean"/>
Hello, <jsp:gatProperty name="hello" property="name"/>
</body>
</html>
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't put your application specific stuff the server directories! Your webapp (context) should have a WEB-INF directory. Put your classes in WEB-INF/classes -- using the directory naming convention for packages -- and your jars in WEB-INF/lib.
- Peter
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic