17 Oracle Web Application Server
How do I…
17.1 Administer Database Access Descriptors (DADs) and Cartridges?
17.2 Return the results of a query to a web document?
17.4 Use multi-valued form fields?
17.5 Use HTML tables in web documents?
17.6 Use JavaScript to handle events?
17.7 Access and use CGI environment variables?
17.8 Maintain persistent states with cookies?
The Oracle Web Application Server (OWAS) 3.0 supports the creation of HTML documents dynamically using stored procedures. The PL/SQL Web Toolkit is a set of stored packages that simplifies the creation of web documents by reducing the need to understand HTML programming. The Oracle Web Listener receives an URL from a web browser and determines whether the request requires the use of a Web Request Broker (WRB) Cartridge, or if the request is for a static HTML page that can be accessed from the file system.
For WRB requests, the WRB dispatcher dispatches the request to a WRB Cartridge. Cartridges for PL/SQL, Java, Perl, ODBC, LiveHTML, and Oracle Worlds are supported in OWAS 3.0. If a stored procedure is invoked from the URL, the PL/SQL Cartridge processes the request, and transmits the HTML documents back to the browser.
OWAS 3.0 also introduces a distributed transaction processing model, based on X/Open open standard. The examples presented in this chapter require that OWAS 3.0 be installed on your system. Before running examples in this Chapter, ensure that you have created the OWA_WAITE PL/SQL Agent and the WAITES Data Access Descriptor (DAD) as illustrated in How-To 17.1.
17.1 Administer Database Access Descriptors (DADs) and Cartridges
Database Access Descriptors (DADs) are required for database access. The PL/SQL Cartridge uses configurable PL/SQL Agents to execute stored procedures. After creating a DAD, it is also necessary to create a PL/SQL Agent and configure its WRB parameters. The virtual path for the application must be set up to map to the PL/SQL Agent. This How-To describes the steps necessary for administering DADs and Cartridges.
17.2 Return the Results of a Query to a Web Document
When developing business applications for the web, it is necessary to display the results of a query within a web page. Packages in the PL/SQL Web Toolkit are used to generate HTML formatted output to display query results. This How-To presents the technique used to display the results of a query within a web document.
17.3 Create an HTML Form
HTML forms allow passing parameters from the web browser to the web application, which in turn interfaces with the database. An HTML form enables the user to enter information in fields, which are then submitted to a stored procedure as parameters. This How-To presents the technique used to create HTML forms.
17.4 Use Multi-Valued Form Fields
There are several instances when you will have to submit a form variable that has multiple values. As each form variable is passed as a PL/SQL parameter, a PL/SQL table is required to handle a multi-valued form field. This How-To presents the technique for using multi-valued form fields.
17.5 Use HTML Tables in Web Documents
HTML tables can be used to organize data by rows and columns. When you query data from Oracle, you will probably want to format the data using HTML tables. Tables enable you to present a wide range of content and can include other HTML tags. This How-To presents the techniques used to create HTML tables using the PL/SQL Web Toolkit procedures.
17.6 Use JavaScript to Handle Events
JavaScript can be embedded in the generated HTML in order to control events triggered by changes to form fields. Using JavaScript becomes necessary especially if you are using frames in the generated web documents. In this How-To, you will learn some esoteric JavaScript techniques for event handling.
17.7 Access and Use CGI Environment Variables
Common Gateway Interface (CGI) environment variables provide valuable information that can be accessed and used in your web application by using the OWA_UTIL package. This How-To covers the process of retrieving CGI variables and using them in your web documents.
17.8 Maintain Persistent States with Cookies
Persistent variables in a session can be stored as cookies in the browser. Cookies are strings saved in the browser and maintain state information throughout the client session, or until the expiration date of the cookie if provided. This How-To demonstrates the use of the OWA_COOKIE package.