String msg = "<HTML><BODY>";
String name = request.getParameter("firstname");
if (name != null) {
msg += "Hello " + name;
}
else {
msg += "Hello whoever you are.";
}
msg += "</BODY></HTML>";
response.setContentLength(msg.length());
response.setContentType("text/html");
try {
PrintStream rs = new PrintStream(response.getOutputStream());
rs.print(msg);
}
catch (IOException e) {
}