Expert Spring MVC and Web Flow

(Dana P.) #1

Configuring the Application


Lastly, it just remains to configure the Viewfor use. In our views.propertiesfile we need two
entries specifying the class name that we want to use and the URL pointing to the template we
want to use. Listing 8-42 has the details.

Listing 8-42.views.properties Configuration for Excel Home Page

home.class=com.apress.expertspringmvc.flight.web.view.HomePageExcel
home.url=/WEB-INF/excel/home

When we hit the home page of our application now, the spreadsheet is created on the fly
from a combination of the model and the template. Either your browser will ask what to do
with it, or it will just fire up your spreadsheet application (Excel or OpenOffice.org, for exam-
ple) to display the output. Figure 8-10 shows how it looks.

Figure 8-10.Spreadsheet view of the home page

JasperReports


JasperReports is an open-source reporting engine written in Java. Report designs are created
in XML and can be output to several different formats. Jasper is a mature reporting engine
now, and a commercial organization ( JasperSoft) has recently been incepted to manage
ongoing development and provide support.
We’re not going to show an example of the report itself because of the verbose syntax,
but we encourage you to take a look at the samples on the Jasper site (http://jasperreports.
sourceforge.net), which has excellent documentation online. In this section we’ll concentrate
on showing how to integrate the reports with your application.

260 CHAPTER 8 ■SUPPORTED VIEW TYPES

Free download pdf