Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Details on installing eclipse are provided in the Development environment section. This tutorial is organized in the following sections:

Table of Contents

Creating a Dynamic Web Project using Eclipse

  1. Launch Eclipse and Switch to Java EE perspective.







  2. Right-click under project explorer and select Dynamic Web Project as shown in the figure




  3. Name the project as HelloWorld.




  4. Keep default values for all the fields and select Finish.




    Adding a JSP to the project

  5. Right-click on the project HelloWorld and create a new JSP as shown in the figure.




  6. Give the name as hello.jsp and select Next. Select Finish on the next screen




  7. Modify the code of hello.jsp as follows:
    Code Block
    titlehello.jsp
    borderStylesolid
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Hello World</title>
    </head>
    <body>
    Hello World!!
    </body>
    </html>
    

Run and Deploy

  1. Deploy the application on the server.




  2. launch the application using http://localhost:8080/HelloWorld/hello.jsp




  3. This will display HelloWorld!! on the browser window.