How to create your first Dynamic Web project in Eclipse

Home > Search > How-to
  by

  1. In Eclipse, select  File > New > Dynamic Web Project.

Note: If you do not have an option to select Dynamic Web Project, select Help > Install New Software, and then select the following:

  • Eclipse Java EE Developer Tools

  • Eclipse Java Web Developer Tools

  • Eclipse Web Developer Tools

  • JST Server Adapters (this is needed to target the application for Tomcat, JBoss, WebSphere, et cetera)

  • JST Server Adapters Extensions (this is needed to target the application for Tomcat, JBoss, WebSphere, et cetera)

  1. Give your project a name, such as myApp. If you have setup a server in Eclipse, select the Target runtime. Select Next.

 

  1. At the Java prompt, select Next.
  2. Athe Web Module prompt, check Generate web.xml deployment descriptor, and select Finish.

 

  1. In the left panel of Eclipse, right-click on myApp and select New > JSP File.
  2. Select the WebContent folder, give the file a name such as index.jsp, and select Finish.

 

  1. The index.jsp file should now be listed under the WebContent folder in the left panel of Eclipse. Add the text Hello World to the index.jsp file.

 

Note: By naming the file index.jsp, there will be no need to modify the welcome-file-list section of the web.xml file, because there should also be a default document for index.jsp.

 

If you have added a server to Eclipse, you can also run the application in Eclipse. For example, if Tomcat has been added to Eclipse, select the green play button and select Run on Server.

 

Select your server and select Finish.

 

Your simple Hello World application should now be display in Eclipse.

 

If you have not added a server to Eclipse, export your application, and then deploy your application on an application server.

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter in the box below so that we can be sure you are a human.




Comments