Beginner Servlet Question
From: Sally Mayne (nospam_at_nospam.com)
Date: 10/19/03
- Previous message: Janet Carmichael: "testing servlet"
- Next in thread: Nathan Zumwalt: "Re: Beginner Servlet Question"
- Reply: Nathan Zumwalt: "Re: Beginner Servlet Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 19 Oct 2003 05:34:44 GMT
Hi:
I am just starting on Servlets and I haven't got too far. I can't seem to
run the program.
System: WinXP, Tomcat 4.1.27
The servlet file is called DontPanic.java - the code is given at the botton
of this email.
The steps I took are:
- I placed the java servlet in C:\Program Files\Apache Group\Tomcat
4.1\webapps\examples\WEB-INF\classes
- I attempted to run this servlet by typing: javac - classpath C:\Program
Files\Apache Group\Tomcat 4.1\common\lib\servlet.jar DontPanic.java
- I received the error message :"javac: invalid flag: Files/Apache""
What have I done wrong - this has been puzzling me for most of today :(
The code for DontPanic.java:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class DontPanic {
public void doGet(
HttpServletRequest request,
HttpServletResponse response
)throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head>");
out.println("<title>Don't Panic</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Don't Panic</h1>");
out.println("</body>");
out.println("</html>");
}
}
- Previous message: Janet Carmichael: "testing servlet"
- Next in thread: Nathan Zumwalt: "Re: Beginner Servlet Question"
- Reply: Nathan Zumwalt: "Re: Beginner Servlet Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|