This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes Class not found error in JSP 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 » Servlets
Bookmark "Class not found error in JSP" Watch "Class not found error in JSP" New topic
Author

Class not found error in JSP

milan doshi
Ranch Hand

Joined: Nov 03, 2000
Posts: 43
Hello,
I am trying to develop a basic JSP application wherein I am trying to import a bean calss called "counter".
I have saved the counter.java & counter.class files in the Root Directory of Tomcat (i.e the same directory wherein lies my JSP file ).
I am trying to import the bean using
<%@ page import="counter"%>
:
:
I am however getting the following error:
org.apache.jasper.JasperException: Unable to compile class for JSPE:\jakarta-tomcat\work\localhost_8080\_0002fbeancounter_0002ejspbeancounter_jsp_0.java:13: Class counter not found in import.
import counter;
Can someone please guide where am I going wrong?
Thanx in Advance,
Milan
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
This is becoming a Frequently Asked Question. The answer is that classes should go in the WEB-INF/classses subdirectory, below where your html files go.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
milan doshi
Ranch Hand

Joined: Nov 03, 2000
Posts: 43
Thanx Frank,
That was really quick and also very helpfull.
Milan
milan doshi
Ranch Hand

Joined: Nov 03, 2000
Posts: 43
Thanx Frank,
That was really quick and also very helpfull.
Milan
 
jQuery in Action, 2nd edition
 
subject: Class not found error in JSP
 
Similar Threads
simple JSP and JavaBean, error 500
Problem in accessing an attribute through action elements
InstantiationException using tomcat4.0 in jsp with beans
Need help with using beans on Tomcat
ARRRGGGGHHH - Stupid Javabeans - Again! :(