Designing Data-Intensive Web Applications

Hypertext implementation is the phase in which the conceptual specification of the front-end of the Web application must be transformed into a set of concrete software components, installable in one of the architectures illustrated in Chapter 10. These components dynamically build the pages of the application from the content stored in the data sources, using one of the data implementation architectures discussed in Chapter 11.
As a platform for exemplifying hypertext implementation, this chapter uses the Java programming language and its extensions for Web development, in particular the JSP server-scripting language and the JDBC database connection interface. However, the discussion proceeds as much as possible on general grounds, so that the illustrated techniques remain valid also in other contexts, for example in the Microsoft .NET architecture, or in a PHP-based Web server.
For simplicity of illustration, we will start explaining the implementation of the various hypertext constructs by associating all the functions needed to dynamically compute a page to a single JSP template. In this way, all the programming tasks necessary for page computation remain concentrated in a single source file, which simplifies the understanding of the implementation techniques.
All the JSP templates that we will discuss share a common structure, which comprises five main sections, each one addressing a specific problem of page computation: the fetching of parameters from the HTTP request, the connection to the database, the query execution and context propagation, the production of the HTML code, and the final disposition of temporary objects.
The...