package com.mindprod.practice;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.*;
import javax.servlet.http.*;
/**
* Capture a GET from an Applet
*/
public class HelloServletWorld extends HttpServlet
{
protected void doGet( HttpServletRequest req,
HttpServletResponse res)
throws ServletException, IOException
{
res.setContentType( "text/html" );
String firstname = req.getParameter( "firstname" );
if ( firstname == null )
{
firstname = "unknown";
}
PrintWriter out = res.getWriter();
out.println("<html><body>Hello, " + firstname + ". Welcome to Servlet World! </body></html>");
out.close();
}
public String getServletInfo()
{
return "HelloServletWorld 1.0 by Roedy Green, echoes firstname parameter.";
}
}