Oracle8i Application Developer's Guide - XML Release 3 (8.1.7) Part Number A86030-01 |
|
Customizing Content with XML: Dynamic News Application, 10 of 16
The application builds dynamic pages on demand by pulling items directly from the database. End-users access the "Create/Edit User Preference Page" to choose categories, subcategories, and types (for example, Entertainment - Movies - Review).
Dynamic pages are useful for delivering up-to-the-minute information, such as breaking news. They are also useful for delivering historical data, such as the closing price of any specified stock on any day in the last 10 years. It would be impractical to pregenerate documents for every possible request, but straightforward and efficient to pull the figures from the database.
Figure 6-4 shows how dynamic generation works. Unlike the other runtime models, the administrator does not pregenerate XML documents. Instead, the Dynamic Servlet queries the database for news items based on the end-user's customization choices.
The servlet stores user preferences both in the database and in a client-side cookie, and reads them from the cookie where possible to improve performance. Using the query results, the servlet generates an XML file and transforms it using an XSL stylesheet into an HTML page for the user's browser. As with the other approaches, the application gets the browser type from the user-agent header of the HTTP request.
|
Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|