This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Custom directory in Java Web Server

 
Parag Mokal
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Dominic Steng�rd
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
------------------
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic