It's not a secret anymore!*
The moose likes JSP and the fly likes bean compilation problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "bean compilation problem" Watch "bean compilation problem" New topic
Author

bean compilation problem

Jesse Crockett
Ranch Hand

Joined: Feb 03, 2005
Posts: 129
I will try to give the precise details of the problem..

I'm trying to use the standard UserData class in the tutorial, I have placed this file, UserData.class, in several folders including the ROOT\WEB-INF\classes folder

Here is my CLASSPATH: .;..;C:\Tomcat 5.5\webapps\ROOT\WEB-INF\classes;C:\Program Files\Java\jdk1.5.0_06\bin

the errors:

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 1 in the jsp file: /SaveName.jsp
Generated servlet error:
UserData cannot be resolved to a type

An error occurred at line: 1 in the jsp file: /SaveName.jsp
Generated servlet error:
UserData cannot be resolved to a type

An error occurred at line: 1 in the jsp file: /SaveName.jsp
Generated servlet error:
UserData cannot be resolved to a type

and the line of code causing the problem:

<jsp:useBean id="user" class="UserData" scope="session"/>

<jsp:setProperty name="user" property="*"/>
<HTML>
<BODY>

<A HREF="NextPage.jsp">Continue</A>

</BODY>
</HTML>

I hope you can help me out. Thanks!
[ June 10, 2006: Message edited by: Bear Bibeault ]
Jesse Crockett
Ranch Hand

Joined: Feb 03, 2005
Posts: 129
I solved it by adding it to a package and changing the class="..." to include the package path. Nothing like spending an hour on this to keep me interested.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Glad you've got it working.

For future reference, there is an entry in the JSP FAQ that covers this.
http://faq.javaranch.com/view?BeansNotFound


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
Don't get me started about those stupid light bulbs.
 
subject: bean compilation problem
 
Similar Threads
Error using beans and JSP
where to place Bean file(*.class)in Tomcat server
compiling bean
Tomcat 4.11 doubt
Unable to compile class for JSP