ReviewIn the previous section, we have created the Jasper report layout using iReport and learned where to place them on our Spring project. In this section, we will focus on the presentation layer and learn how to display data using HTML and jqGrid.
Table of ContentsPart 1: Introduction and Functional Specs
Part 2: Java classes
Part 3: Jasper layout with iReport
Part 4: HTML and jqGrid
Part 5: XML configuration
Part 6: Running the Application
Presentation LayerWe will use jqGrid to display our data in an interactive table and jQuery to provide AJAX support.
What is jQuery?
What is jqGrid?
PreviewWe only have a single HTML file (users.jsp, a JSP to be exact) to perform all actions. This page contains our jqGrid table and buttons for downloading reports in Pdf and Excel format.
You might be asking: "What's that humongous lines of jibberish code?" If you'd been following my blog, you would notice that I have tackled jqGrid a couple of times from my previous tutorials. If my explanation in this tutorial isn't enough, please see the following tutorials for an alternative perspective:
- Spring MVC: Integrating MySQL, MongoDB, RabbitMQ, and AJAX - Part 1: jQgrid View
- jqGrid and Spring 3 MVC Integration Tutorial
- Spring 3: Dynamic MVC using jqGrid and MongoDB
An In-depth LookIf we partition this JSP page, you will notice the following sections:
- URL imports
- jqGrid initialization
Pay attention to the download() function's algorithm:
1. Retrieve a download token via AJAX.
2. Store the token.
3. Show download progress dialog box.
4. Start actual download.
5. Do a periodic AJAX call to verify if token still exists. If not, hide download progress box.
- HTML table
NextIn the next section, we will focus on the configuration files for enabling Spring MVC. Click here to proceed.
Share the joy:
Subscribe by reader Subscribe by email Share