• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Class Not Found using JSWDK

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!!!

 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try making your class a member of a package, and then import the entire package.

Bosun
 
Saloon Keeper
Posts: 28753
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Hermione Krum
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!!!
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 328
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic