tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will Hartung" <wi...@msoft.com>
Subject Re: class files not being found
Date Wed, 15 Jan 2003 19:05:13 GMT
> From: "Jeff Ousley" <jeofatima@yahoo.com>
> Sent: Wednesday, January 15, 2003 10:35 AM
> Subject: class files not being found


> All,
>
> I'm using tomcat 4.1 and I'm noticing that unless your
> .class file is not part of a package and in the proper
> directory structure under the classes directory, it
> cannot be found. Is there a way to use .class files
> found under WEB-INF/classes that are not part of a
> package?

Are you talking about within JSPs?

The problem, specifically with JSPs, is not so much that your classes are
not within a package, but rather that the JSPs generated servlets ARE within
a package.

Since these servlets are within a package, they can not see any classes
within the "anonymous" package, which is where your classes are.

If you look within the 4.1.x examples webapp, there are several servlets in
the classes directory that do not have packages, and these work just fine.

So, anyway, the answer is "Yes you can use classes without packages in the
classes directory", and "No, you can not use classes without packages in
JSPs at all". But it's easily remedied. Simply place your classes within a
package and be done with it. They should be there anyway.

Regards,

Will Hartung
(willh@msoft.com)




--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message