[Help with running servlets]
Hi, I'm doing a project on servlets, and I'm having problems compiling them. I know where I've gone wrong, but I need some help getting it right. It's do with with, hooray, the classpath variables.
The API for servlets & JSP has to be downloaded from Sun Microsystems’ Java site, at: http://java.sun.com/products/jsp/download.html or the API is ready-packed into the Enterprise Edition of the Java 2 Platform package. However, in my case, I have been told to use the developer's web facility on the university server. Here is an extract from the documentation they provided:
Important point #1: I'm not running the servlets on my own PC, so I can't set environment (set CLASSPATH blablabla)variables in the autoexec.bat file or anything.
Important point #2: The server is running on Apache Tomcat, & also, I have to use XTerm windows - interfaces to Unix OS from a PC on MS OS; I'm not using MS DOS.
I understand that the command to compile a *.java file together with TWO specified APIs existing in TWO separate folders would read something like this (example):
javac GetHTTPServlet.java -classpath DEVWEB/servlet/servlet_classes/classes11 1.zip; /DEVWEB/userlets/WEB-INF/servlets.jar
The documentation for the javac command in J2EE(I think) 1.4 down at Sun states that the path should end with the extensions of the files, in the case of *.jar & *.zip files.
I know that the compiler is working, because the rest of the code is fine; all the errors returned point to servlet-package-related elements. Have I been silly, & gone & typed something wrong?
I've tried god knows how many methods (most of which were really weird ones, driven by desperation) - I've even tried physically copying the actual aforementioned *.jar & *.zip files smack into the same folder.
.... HELP!! PLEASE!! T_T
The API for servlets & JSP has to be downloaded from Sun Microsystems’ Java site, at: http://java.sun.com/products/jsp/download.html or the API is ready-packed into the Enterprise Edition of the Java 2 Platform package. However, in my case, I have been told to use the developer's web facility on the university server. Here is an extract from the documentation they provided:
"The class jars/zips are in ~/servlets/servlet_classes. There are jars for compiling servlets and jdbc for Oracle 7.3. You will need to add both files to your CLASSPATH variable.
There is a test servlet called hello which is in ~username/DEVWEB/userlets/WEB-INF/classes/hello.class which has a URL of http://hostname/~username/userlets/hello. You may need to use http://hostname:8080/usernames/hello "
Important point #1: I'm not running the servlets on my own PC, so I can't set environment (set CLASSPATH blablabla)variables in the autoexec.bat file or anything.
Important point #2: The server is running on Apache Tomcat, & also, I have to use XTerm windows - interfaces to Unix OS from a PC on MS OS; I'm not using MS DOS.
I understand that the command to compile a *.java file together with TWO specified APIs existing in TWO separate folders would read something like this (example):
javac GetHTTPServlet.java -classpath DEVWEB/servlet/servlet_classes/classes11
The documentation for the javac command in J2EE(I think) 1.4 down at Sun states that the path should end with the extensions of the files, in the case of *.jar & *.zip files.
I know that the compiler is working, because the rest of the code is fine; all the errors returned point to servlet-package-related elements. Have I been silly, & gone & typed something wrong?
I've tried god knows how many methods (most of which were really weird ones, driven by desperation) - I've even tried physically copying the actual aforementioned *.jar & *.zip files smack into the same folder.
.... HELP!! PLEASE!! T_T
