Table of ContentsPart 1: Introduction and Functional Specs
Part 2: Java classes
Part 3: XML configuration
Part 4: HTML (with AJAX)
Part 5: Running the Application
A Closer LookAt first glance, this JSP file seems complex. On the contrary, it's quite simple. Let's break it into smaller pieces for clarity:
The following declares our URLs as mapped to our UserController. We're using the url taglib to make the URL portable.
What is jQuery?
- loadTable(): Performs an AJAX request and populates our table with records
- toggleForms(): Hides and shows specific forms based on the passed argument
- toggleCrudButtons(): Hides and shows buttons
- hasSelected(): Checks whether a record has been selected
- fillEditForm(): Fills the Edit form with details based on the selected record
- submitDeleteRecord(): Submits a delete request via AJAX
- submitNewRecord(): Submits a create new record request via AJAX
- submitUpdateRecord(): Submits an update record request via AJAX
Table and buttons
This is a simple table for displaying records. The buttons are for interacting with the data.
These are forms used when adding and editing records.
PreviewIf we run our application, this is what we shall see:
For more screenshots, please visit Part 1 of this tutorial and check the Screenshots section.
NextIn the next section, we will build and run the application using Maven, and show how to import the project in Eclipse. Click here to proceed.
Share the joy:
Subscribe by reader Subscribe by email Share