Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Class not found error in JSP

 
milan doshi
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
milan doshi
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx Frank,
That was really quick and also very helpfull.
Milan
 
milan doshi
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx Frank,
That was really quick and also very helpfull.
Milan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic