Hi, I'm very new to server side. I'm using JDK1.3 on Win98 and already set up Tomcat. I have no problem running the examples. But when I tried to use compile some of the source code in the example(of course, you already have the class files sitting there). I just want to compile myself but get a bunch of errors. It seems javax.servlet package is not included in JDK1.3. So do I need to have J2ee to develop servlets? Or there is some way out.
Sun Certified Java Programmer
Joined: Dec 24, 2000
I find this in one tutorial at sun's site: Before you can invoke a servlet, you must compile it. Many vendors offer IDEs equipped with servlet wizards that make it easy to create and compile servlets almost automatically. The Guestbook servlet presented in this article was created and compiled using IBM's WebSphere Studio IDE. Does it mean we can't compile servlet with EditPlus or TextPad? I'm still a loss when it comes to compile codes with "import javax.servlet.*" The compiler always fails to recognize this package. What am I missing here? I would appreciate if someone can help me out. Weiye Tang
You definately can compile a servlet (and EJB's too) with TextPad, this is what I use.
The only thing you need to do is include the appropriate jar file in the classpath (in your case, servlet.jar). I've set up a custom command to do this. In TextPad, Configure|Preferences|Tools then click the Compile Java and in the Parameters, include " -classpath mypathto/servlet.jar" in front of the $File
Joined: Dec 24, 2000
One book instructed to copy servlet.jar to jdk1.3\lib\ext And then all the servlet compiles fine. But I don't know why. The ext folder is empty before copying.
Originally posted by Tom Tang: One book instructed to copy servlet.jar to jdk1.3\lib\ext And then all the servlet compiles fine. But I don't know why. The ext folder is empty before copying.
Hi guys, I'm using JRun3.0 and in case anyone else using JRun has this problem, the servlet.jar class is in the lib/ext directory. I copied the jar file to the jdk sub directory as suggested above, but that didn't quite work for me, however I added the path to my classpath and thankfully I'm now able to compile servlets using Textpad. Thanks for the info above guys.