>>> Pat Willard <[EMAIL PROTECTED]> 4/10/99 10:10:25 PM >>>
>I'm man enough to ask really stupid questions in a public
>forum such as this.
Don't worry about asking questions. That's what this forum is for.
>The question is: How the h**l do I compile a servlet.
>package javaservlets.samples;
>import javax.servlet.*;
>import javax.servlet.http.*;
>public class Properties extends HttpServlet {
>I've tried to compile it with the command: javac First.java
>I get errors saying that javaservlets.samples, javax.servlet.* and
javax.servlet.http "not found".
Firstly the naming of your class is wrong.
In Java a class needs to be named the same as the file.
So if you have a class called Properties then save it in a file
called Properties.java.
Secondly if you include the package statement then that alters Java's
perception of where it will find the source file and what it will call
the compiled code.
If a file is in package nicstools.servlets then javac expects to find
the file in a directoiry called nicstools/servlets in the current
directory.
So, in short to fix your problem:
- take out the package line from the file
- save the file as Properties.java
- it should compile (unless there are other errors that you haven't
mentioned).
You can then copy the resulting Properties.class to the servlets
directory of Java Web Server. That will enable you to load the servlet
by requesting it in the browser like this:
http://yourwebserver/servlets/Properties
Hope this helps.
Nic Ferrier
Tapsell-Ferrier Ltd
www.tapsellferrier.co.uk
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html