Thanks again, but I don't understand. As I said, the classpath to servlet.jar is in my system's CLASSPATH environment environment. I thought the point of putting it in the CLASSPATH environment variable was so that it would find it when I attempt to compile, otherwise why create the CLASSPATH variable in the first place?

Thanks

Billy


From: Kwok Peng Tuck <[EMAIL PROTECTED]>
Reply-To: "Tomcat Users List" <[EMAIL PROTECTED]>
To: Tomcat Users List <[EMAIL PROTECTED]>
Subject: Re: Problem Compiling JSP Servlet
Date: Fri, 03 Oct 2003 09:47:43 +0800



This works: javac HelloServlet.java -classpath c:\Tomcat\common\lib\servlet.jar
This doesn't: javac HelloServlet.java



Billy, the second line implies that you did not include the classpath to servlet.jar, so that's why it is having problems
with javax.servlet.ServletException. If you find it tedious to type that in the command line, try investing some time to learn ant to help you build and complie
your files.







---------- Code --------------- import java.io.*; import javax.servlet.*; import javax.servlet.http.*;

/** Simple servlet used to test server.
*  <P>
*  Taken from More Servlets and JavaServer Pages
*  from Prentice Hall and Sun Microsystems Press,
*  http://www.moreservlets.com/.
*  &copy; 2002 Marty Hall; may be freely used or adapted.
*/

public class HelloServlet extends HttpServlet {
 public void doGet(HttpServletRequest request,
                   HttpServletResponse response)
     throws ServletException, IOException {
   response.setContentType("text/html");
   PrintWriter out = response.getWriter();
   String docType =
     "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
     "Transitional//EN\">\n";
   out.println(docType +
               "<HTML>\n" +
               "<HEAD><TITLE>Hello</TITLE></HEAD>\n" +
               "<BODY BGCOLOR=\"#FDF5E6\">\n" +
               "<H1>Hello</H1>\n" +
               "</BODY></HTML>");
 }
}

_________________________________________________________________
Instant message in style with MSN Messenger 6.0. Download it now FREE! http://msnmessenger-download.com



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


_________________________________________________________________
Frustrated with dial-up? Get high-speed for as low as $29.95/month (depending on the local service providers in your area). https://broadband.msn.com



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to