Java Web development tutorial Eclipse
This application is a simple Hello World application which will output Hello World!! on the browser. It needs a dynamic Web project and a JSP associated with it.
To run this tutorial, as a minimum you will be required to have installed the following prerequisite software:
- Sun JDK 6.0+ (J2SE 1.6)
- Eclipse IDE for Java EE Developers, which is platform specific
- Apache Geronimo Eclipse Plugin 2.1.x
- Apache Geronimo Server 2.1.x
Geronimo version 2.1.x, Java 1.5 runtime, and Eclipse Ganymede are used is used in this tutorial but other versions can be used instead (e.g., Geronimo version 2.2, Java 1.6, Eclipse Europa)
Creating a dynamic Web project using Eclipse
- Launch Eclipse and Switch to Java EE perspective.
- Right click under the project explorer and select Dynamic Web Project as shown in the figure
- Name the project as HelloWorld.
- Keep default values for all the fields and select Finish.
Adding a JSP to the project
- Right-click on the project HelloWorld and create a new JSP as shown in the figure.
- Give the name as hello.jsp and select Next. Select Finish on the next screen
- Modify the code of hello.jsp as follows:
Making hellp.jsp the welcome file
- Click WebContent -> WEB-INF and open web.xml.
- Add hello.jsp as a welcome file under the tag: