I tried a servlet program where i placed the .java file in bin and in the source. I tried compiling both. It shows error in import javax.servlet, http methods. What is the reason for these errors?
Not sure what you mean by "bin", but it doesn't sound like the right place for source files. How are you adding the jar file that contains the javax.servlet and javax.servlet.http packages to the classpath?
I tried to create class file first in src inside webapps/.../src/Helloworld.java and then tried keeping the source file inside bin I also tried keeping the source file inside d: setting home,path and class path. Please let me know the correct procedure.
It doesn't matter where the source files are, but whatever "bin" is (I can't tell from your post), it sounds like a place for binaries, not source code.
For compiling servlets you don't need anything else but servlet-api.jar in the classpath. You can achieve that by compiling somewhat like this: