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?
sahana mithra
Ranch Hand
Joined: Oct 26, 2010
Posts: 72
posted
0
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.
sahana mithra
Ranch Hand
Joined: Oct 26, 2010
Posts: 72
posted
0
which package should i add i mean which jar file should i add other than servlet-api.jar and where should i add it?
Lester Burnham
Rancher
Joined: Oct 14, 2008
Posts: 1337
posted
0
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: