HI, I'm just starting on JSP and Servlets and I have the JSWDK-1.0 installed and running (it was very easy to set up). I have no difficulties running JSP's with includes, directives expressions, etc. However when I tried to compile this example servlet from a web tutorial
I get 6 errors because the import statements don't seem to work. Any ideas? Thanks,
Yup. 1. Are you really trying to compile them the servlet - i.e. use the "Javac" command? Or are you thinking that they work the same way that JSPs do? They don't. Think of them as Java Applications. 2. Assuming you're compiling properly, do you have the CLASSPATH set up properly? You didn't mention which imports were failing, but if java.io.* is OK and the javax.servlet imports fail, it's because your classpath for javac doesn't include the servlet.jar file from your JSWDK distribution.
An IDE is no substitute for an Intelligent Developer.
HI, Thank you both for your quick answers. Tim: Yes I'm using the javac command - I got that far The class path was the trouble. When following the instructions in the faq I put the servlet.jar in but with the JDK path not the JSWDK path. I set that right and now it compiles fine. JDJ: Guess where I got the example code??? Yes. I have just started that tutorial.
Thanks again to both of you.
Terry Doyle [This message has been edited by Terence Doyle (edited September 11, 2001).]