I'm using Java Web Server for running servlets. Every time I want to run a servlet I've to put it into the 'sevlets' directory of JWS. But I want to put the servlets into my own custom directory. How do I go about it. Even if I create a sub-directory inside the 'servlets' directory, I cannot run the servlets from there.
posted 16 years ago
Hello Parag! I have not used the Java Web Server myself, as I use Apache/Tomcat. But I think that what you have to do to make a directory being able to run your servlets, is making sure your classpath is set to the custom servlet directory. The second issue, "Even if I create a sub-directory inside the 'servlets' directory, I cannot run the servlets from there", is probably because you have not set the package attribute in the servlets correctly. Example: if you have a sub directory called 'sub', you need to declare that the servlets in this directory have the statement: 'package sub;' in the heading. Happy hacking! Regards
------------------ Dominic Steng�rd Sun Certified Java 2 Programmer ------------------