You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jeff Ousley <je...@yahoo.com> on 2003/01/15 19:35:02 UTC

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?

thanks!
-jwff

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: class files not being found

Posted by Will Hartung <wi...@msoft.com>.
> From: "Jeff Ousley" <je...@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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>