Creating a dynamic web project

We will perform the following steps to create a dynamic web project:

  1. Select the File | New | Other menu. This opens the selection wizard. At the top of the wizard, you will find a textbox with a cross icon on the extreme right side.
  2. Type web in the textbox. This is the filter box. Many wizards and views in Eclipse have such a filter textbox, which makes finding items very easy.
Figure 2.7: New selection wizard
  1. Select Dynamic Web Project and click Next to open the Dynamic Web Project wizard. Enter project name, for example, LoginSampleWebApp. Note that the Dynamic web module version field in this page lists Servlet API version numbers. Select version 3.0 or greater. Click Next.
Figure 2.8: New Dynamic Web Project wizard
  1. Click Next in the following pages and click Finish on the last page to create a LoginSimpleWebApp project. This project is also added to Project Explorer.
Figure 2.9: New web project

Java source files go in the src folder under Java Resources. Web resources such as the HTML, JS, and CSS files go in the WebContent folder.

In the next section, we will create a JSP page for login.

To keep the page simple in the first JSP, we will not follow many of the best practices. We will have the UI code mixed with the application business code. Such design is not recommended in real applications, but could be useful for quick prototyping. We will see how to write better JSP code with clear separation of the UI and business logic later in the chapter.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
13.58.50.156