Creating Servlet in Eclipse IDE with Tomcat

Now learn this page how can create web project in Eclipse IDE. Let's see steps by steps create web project.

  • Create a Dynamic web project
  • create a servlet
  • add servlet-api.jar file
  • start tomcat server and deploy the project

Creating a Dynamic Web Project

For creating a dynamic web project click on File Menu -> New -> Project..-> Web -> dynamic web project -> write your project name e.g. FirstDemo -> Finish.

Create the servlet in eclipse IDE

For creating a servlet explore the project by clicking the + icon -> explore the Java Resources -> right click on src -> New -> servlet -> write your servlet name e.g. Hello -> uncheck all the checkboxes except doGet() -> next -> Finish.


For starting the server and deploying the project in one step Right click on your project -> Run As -> Run on Server -> choose tomcat server -> next -> addAll -> finish.