Servlet in eclipse IDE: by R4R Team

Step to use Servlet in eclipse IDE:

Creating servlet example in eclipse IDE, saves a lot of work to be done. It is easy and simple to create a servlet example. Let's see the steps, you need to follow to create the first servlet example.

Create a Dynamic web project
create a servlet
Run the servlet

1) Create the 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. first -> Finish.

create the project name--->

project name--->

create new Class--->

2) 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.


start the java class--->e.g
3) Start the server and deploy the project:

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. for more see the  tomcat server configration...

Leave a Comment: