I've been progressing rapidly: I now have servlets working on my (hosted) webserver, and my classes (in /servlets) can access any classes in the /servlets directory.
Now, before things become too messy, I'd like to be able to create libraries of classes (and use other's libraries).
I understand that I can't just add .JAR files to the CLASSPATH (that can only be done by the administrators of our web host), but I think I should be able to place utility .class files in a subdirectory hierarchy, such as:
and I should then be able to use all "myclass" (and all other classes in that directory).
However, I have a simple .java servlet (say, TestUtil.java/.class), that tries to do this. If I place the utility .class files, compiled WITHOUT the "package com.mycompany.classlib" at the beginning, into the /servlets directory, it works fine.
If I, instead, put the "package" statements in, place the utility .class files into the subdir, and compile them there, then put them in that subdir on the server, and delete the duplicate .class files out of /servlets, the server returns "Internal Server Error" when I try to access TestUtil.
What am I missing?
Now, before things become too messy, I'd like to be able to create libraries of classes (and use other's libraries).
I understand that I can't just add .JAR files to the CLASSPATH (that can only be done by the administrators of our web host), but I think I should be able to place utility .class files in a subdirectory hierarchy, such as:
Code:
/servlets/com/mycompany/classlib/myclass.class[/cod]
and then:
[code]imports com.mycompany.classlib.*
However, I have a simple .java servlet (say, TestUtil.java/.class), that tries to do this. If I place the utility .class files, compiled WITHOUT the "package com.mycompany.classlib" at the beginning, into the /servlets directory, it works fine.
If I, instead, put the "package" statements in, place the utility .class files into the subdir, and compile them there, then put them in that subdir on the server, and delete the duplicate .class files out of /servlets, the server returns "Internal Server Error" when I try to access TestUtil.
What am I missing?