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 using JSWDK 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 using JSWDK" Watch "Class Not Found using JSWDK" New topic
Author

Class Not Found using JSWDK

Hermione Krum
Greenhorn

Joined: Aug 27, 2001
Posts: 3
Hi there, I am trying to import a bean class "FileListFilter", and I have put the FileListFilter.class in the WEB-INF/servlets and I am trying to import the bean using
<%@ page import="FileListFilter"%> however, the compiler keeps complaining:
com.sun.jsp.JspException: Compilation failed:work\%3A8080%2Fproject\index_jsp_1.java:17: Class FileListFilter not found in import.
import FileListFilter;
^
1 error
Please help and Thanks so much!!!

Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Try making your class a member of a package, and then import the entire package.

Bosun


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15950
    
  19

It's not WEB-INF/servlets - you should be placing the file in WEB-INF/classes! With subdirectories matching the components of the package name if you defined the class as a member of a packed.


Customer surveys are for companies who didn't pay proper attention to begin with.
Hermione Krum
Greenhorn

Joined: Aug 27, 2001
Posts: 3
I try to make the class a member of a package, and then import the entire package, actually I've put the class("FileListFilter") inside an existing example package("num"), it works fine when I import the package using <%@ page import="num.*"%>, however it fails when I try to call FileListFilter within the jsp!!
And for placing the file in WEB-INF/classes, there's no directory as "classes" in JSWDK, does it mean that I have to add it by myself?? And in fact I try to add the directory "classes" under WEB-INF, and put my classes inside it.. but it still fails when I import the package by using <%@ page import="FileListFilter"%>.
Thanks so much for your help!!!
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

well if FileListFilter is inside the num package, you need to import it like that.
<%@ page import="num.FilListFilter" %>

Also, unless there is a business directive not to, you should really not be using the JSWDK. Tomcat is the RI, Sun even says so.
Terence Doyle
Ranch Hand

Joined: May 30, 2001
Posts: 328
HI,
Mike Curwen said:
Also, unless there is a business directive not to, you should really not be using the JSWDK. Tomcat is the RI, Sun even says
so.

I'm using the JSWDK-1.0 at home for testing and learning purposes. It's the only thing I found for JSP on W98. Does your reccomendation apply to learners or just commercial application deployment?

Terry


Raising Flares debut album 'Ignition' out now

http://www.raisingflares.com

Terry Doyle <br />SCPJ 1.4 , SCWCD , SCMAD(Beta)
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

It applies to you as well.

Tomcat works fine on win98. There are a few tweaks that you may need to do regarding memory. But they've been asked and answered several times here at the ranch, so as soon as you get a certain error, just use Javaranch's search function and you'll find lots of help.

Not only is it the better product, the JSWDK hasn't been updated in a quite some time, so you are using an older version of both the servlet and JSP spec. Better to upgrade.
[This message has been edited by Mike Curwen (edited September 18, 2001).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Class Not Found using JSWDK
 
Similar Threads
@Local annotation on the bean implementation class
how to write to a csv file ??
Class not found error in JSP
Improving performance of JTree ?
File Exists Wildcard