Start NetBeans IDE

Open New Project

Select JavaWeb– WebApplication

Give Name and Location of your Project

Select Server and Settings

Select Frameworks-Don’t select anything now.

index.jsp file is the jsp page which is displayed

Run the file using F6

Right Click on the ProjectName in left here WebApp and select New- Servlet

Give Name and Location for the Servlet

Configure Servlet Information

The Servlet get displayed- HelloWorldServlet

Uncomment the line inside processRequest method to run the servlet and edit as per your requirement

Right Click on the Servlet to Run it

Set Servlet Execution URI

O/P of the Servlet in a Browser Window. 😀