In this post I am going to show how to create First JSP Program using Eclipse IDE and Tomcat Server.
Final Output we have to achieve:
We will follow following 9 steps to create our first JSP Program using Eclipse and Tomcat.
Open Eclipse in your work space.
Select, menu File --> New --> Dynamic Web Project.
Keep rest of the settings as shown below.
Click Next
Click on checkbox and click "Finish" button and Eclipse IDE will generate the web project automatically as shown in Screenshot
Right click on 'WebContent' folder and select from context menu New --> Jsp File.
Give the name of the file as "index.jsp" in the 'File Name' field and Click "Finish" button.
Edit the generated 'helloWorld.jsp' as per the following code.
Right click on 'helloWorld.jsp' and select from context menu 'Run As' --> 'Run on Server'.
As we followed all steps now, we have successfully achieved our output page.
Final Output we have to achieve:
We will follow following 9 steps to create our first JSP Program using Eclipse and Tomcat.
1. Open Eclipse IDE in J2EE perspective.
Open Eclipse in your work space.
2. Create a Dynamic Web Project from File menu.
Select, menu File --> New --> Dynamic Web Project.
3. Enter "HelloJSP" as the project name.
Keep rest of the settings as shown below.
Click Next
4. Click "Next" button.
5. Check 'Generate web.xml deployment descriptor
Click on checkbox and click "Finish" button and Eclipse IDE will generate the web project automatically as shown in Screenshot
6.Create Jsp page
Right click on 'WebContent' folder and select from context menu New --> Jsp File.
7. Name "index.jsp"
Give the name of the file as "index.jsp" in the 'File Name' field and Click "Finish" button.
8. Write JSP Code
Edit the generated 'helloWorld.jsp' as per the following code.
9. Run Your Code
Right click on 'helloWorld.jsp' and select from context menu 'Run As' --> 'Run on Server'.As we followed all steps now, we have successfully achieved our output page.
0 Comments