Free Data Structures and Algorithms Course

Subscribe below and get all best seller courses for free !!!


Subscribe to all free courses

How to create simple Hello World Servlet application in Java ?

Program to demonstrate working of a simple Hello World servlet

package com.hubberspot.servlet.example;

import javax.servlet.*;
import javax.servlet.http.*;

public class HelloWorld extends HttpServlet 
  public void doGet(HttpServletRequest request, 
          HttpServletResponse response) 
          throws ServletException, IOException 
    PrintWriter out = response.getWriter();

Hello World


Output of the program on the web browser :

© 2021 Learn Java by Examples Template by Hubberspot