J. Blustein
Source Code
//
// HelloClientServlet 1.0 by Stefan Zeiger
// From <URL:http://novocode.de/doc/servlet-essentials/chapter2a.html#2_1>
//
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class HelloClientServlet extends HttpServlet
{
protected void doGet(HttpServletRequest req,
HttpServletResponse res)
throws ServletException, IOException
{
res.setContentType("text/html");
PrintWriter out = res.getWriter();
out.println("<HTML><HEAD><TITLE>Hello Client!</TITLE>"+
"</HEAD><BODY>Hello Client!</BODY></HTML>");
out.close();
}
public String getServletInfo()
{
return "HelloClientServlet 1.0 by Stefan Zeiger";
}
}
[see how it is compiled]
- Version:
- 29 Oct 2001
- CS 4173 Prof:
- J. Blustein
<jamie@cs.dal.ca>