tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Desaulniers, Peter" <>
Subject Class file locations for use with JSPs
Date Thu, 09 Nov 2000 02:48:36 GMT
Hello there,

I am using tomcat 3.0 to serve up an application that starts with a servlet
and then get forwarded to a jsp page for the response.  The relevent
directory structure looks like this (no surprises here, I think):

    +-- webapps
        +-- myApp
            +-- jsp
            +-- Web-inf
                +-- classes

The jsp file, myJSP.jsp, is in the jsp directory.
The servlet, myServlet.class is in the classes directory.
The Worker class (this is the problem I will be getting to), Worker.class,
is also in the classes directory.

To fire this off, I use some mappings but essentially this is how it goes:


The mappings get resolved to calling myServlet.  myServlet, imports,
instantiates and calls methods in Worker.  That works great!  Then if
forwards the request to the jsp.  Again that works great.

Now for the problem.  I have <%@ page import="Worker.*" %> and its happy
with that.  However, when I try to do <% Worker w = new Worker(); %> the jsp
compilation fails with: 

org.apache.jasper.JasperException: Unable to compile class for
JSPF:\jakarta-tomcat\work\localhost_8080%2Fdscgi\_0002fdscommands_0002fmyJSP Class jsp.Worker not found.
                  Worker w = new Worker();
F:\jakarta-tomcat\work\localhost_8080%2Fdscgi\_0002fjsp_0002fmyJSP_0002ejspm Class jsp.Worker not found.
                  Worker w = new Worker();

It also happy for me to import java.util.Date and then instantiate a new
date then call Date methods, so it has to do something with my private

I think perhaps, I am not putting the Worker.class file in the correct
place.  I don't think one is suppose to rely on CLASSPATH to specify class
files within the web server / servlet engine context.

By the way, myServlet and Worker are not using packages at all.

Can anyone tell me what I am doing wrong?


-- Peter Desaulniers                                    

View raw message