Advance Java‎ > ‎JSP/Servlet‎ > ‎

Create Eclipse Web Project

Create Web Project 

Step#1: In the Eclipse IDE, navigate to File > New > Other… in order to bring up the project creation wizard.


Step#2: Scroll to the Web folder, open it and choose Dynamic Web Project. Then choose Next.


Step#3: Enter project name "MyWebProject" and choose target run time server "Tomcat" and then click Next button.


Step#4: Now you will get the /src folder, now click the Next button.


Step#5: Select check box "Generate web.xml deployment descriptor" for the xml file then click on Finish button.


Step#6: You can see that your project has been created. Now create your .java files in  /src folder and web pages .jsp files in /WebContent folder. 

Step#7: Create a file Hello.jsp in /WebContent folder containing HTML code.

        <H1>Hello JSP</H1>

In order to run Hello.jspright click on Hello.jsp file, select Run As option, then click on Run on Server option.


Step#8: Choose Tomcat Server from the list and click Finish button.      


Step#9: JSP will be shown in new tab of Eclipse


Configure Tomcat with Eclipse Web Project 

Step#1: If you find "none" server while creating Web Project in above Step # 3 then configure it by clicking "New Runtime" button.


Step#2: Select Tomcat 7 from the selection list.


Step#3: Browse TOMCAT_HOME folder where Tomcat 7 files exist then click on Finish button.