In this article, we will find out about how to create dynamic web project with servlet, jsp in eclipse, how to add external jar files, add new server into our project.
Table of contents
Create dynamic web project Java
-
Select
File->New->Project.
-
Go to the
New Projectdialog.
Select
Webfolder –>Dynamic Web Project. -
Click
Nextbutton.
Type our project name, and select
Dynamic web module version. -
Click
Nextbutton.
-
Click
Nextbutton.
We should select checkbox
Generate web.xml deployment description.And finally, click
Finishbutton.
Add new server into our project
In order to run our project, first of all, we need to add new server such as Resin, Tomcat, Glassfish.
-
Right click on our project in
Project Explorer. SelectNewitem, then, chooseOtheritem.
-
Go to the
Newdialog. SelectServerfolder, chooseServer. ClickNextbutton.
-
Go to the
New Serverdialog. ChooseResinandResin 4.0.
-
Click
Nextbutton.
In this dialog, we can repair some information about server such as Port, username, password, …
-
Click
Nextbutton.
-
Click
Finishbutton.
Add external libraries
-
Right click on our project in
Project Explorer.
Select
Build Path–>Configure Build Path .... -
Go to the
Properties for ...dialog.
Click
Add External JARs...button. -
Go to the
JAR selectiondialog.
At this dialog, we will choose some jar file that we need in our project.
-
After finished to choose some jar files, we have:

Click
Applybutton –>OKbutton.
Refer:
https://www.javahelps.com/2015/04/java-web-application-hello-world.html
https://www.studytonight.com/servlet/creating-servlet-in-eclipse.php
https://stackoverflow.com/questions/2349633/doget-and-dopost-in-servlets