aspose file tools*
The moose likes JSP and the fly likes Error while calling beans in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Error while calling beans in jsp" Watch "Error while calling beans in jsp" New topic
Author

Error while calling beans in jsp

Trident Executive
Greenhorn

Joined: Aug 06, 2003
Posts: 1
Hi everybody,I'm having problem while calling bean class in my jsp e.g. <jsp:useBean id="user" class="UserData" scope="session"/> gives me an error that "cannot resolve symbol : class UserData",i'm keeping my UserData.class in web-inf\classes directory and have set the classpath in system as well as in catalina.bat.
Plz suggest me the possible solution asap.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"Trident Executive",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp.
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please edit your profile and select a new name which meets the requirements.
Thanks.
Dave
Sudharsan Govindarajan
Ranch Hand

Joined: Jul 03, 2002
Posts: 319
Don't u have a package structure for ur classes. If you dont have, putting your classes into some package will avoid lot of frustrations like this.
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
This needs to be an FAQ somewhere. A bean class used in a JSP must be in a package.


Ron Newman - SCJP 1.2 (100%, 7 August 2002)
Garry Jackson
Greenhorn

Joined: Aug 11, 2003
Posts: 8
I've actually managed to include a bean outside of a package using the import statement in the jsp, for example:-
<%@ page language="java" import="iBean" %>
The bean class just sits in the WAR structure under WEB-INF/classes
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
That will work in Java 1.3 but not in 1.4.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error while calling beans in jsp