Java Blog

 
 
 
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class HelloWorldServlet extends HttpServlet {

    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException
    {
        response.setContentType(\"text/html\");
        PrintWriter out = response.getWriter();
        out.println(\"<html>\");
        out.println(\"<body>\");
        out.println(\"<head>\");
        out.println(\"<title>Hello World!</title>\");
        out.println(\"</head>\");
        out.println(\"<body>\");
        out.println(\"<h1>Hello World!</h1>\");
        out.println(\"</body>\");
        out.println(\"</html>\");
    }
}

 
 
Didn't find what you were looking for? Find more on RMI servlet program to display message