aspose file tools*
The moose likes Servlets and the fly likes jsp: useBean not finding Bean class plz help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "jsp: useBean not finding Bean class plz help" Watch "jsp: useBean not finding Bean class plz help" New topic
Author

jsp: useBean not finding Bean class plz help

amit shukla
Ranch Hand

Joined: Oct 25, 2000
Posts: 45
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

Joined: Jan 04, 2001
Posts: 71
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

Joined: Oct 25, 2000
Posts: 45
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

Joined: Apr 20, 2000
Posts: 3252
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp: useBean not finding Bean class plz help