Chapter 8. Building Web Sites with Oracle9i

Several ways are available to process HTML (Hypertext Markup Language), the language that Web browsers understand. Figure 8.1 illustrates the typical static Web environment in which all the files are generated ahead of time in an HTML format that contains tags telling the Web browser how to display various items. Each computer hosting a Web server has an HTTP (Hypertext Transfer Protocol) listener or a Web listener—these are the same. An HTTP or Web listener is assigned to a specific TCP/IP port on the computer and listens for URLs addressed to that particular computer and port.

Figure 8.1. Web browser accessing an HTML file.


This chapter teaches you the following:

NOTE

URL— Stands for Uniform Resource Locator, which is the addressing mechanism of the World Wide Web. It contains the computer's TCP/IP address (or a name that translates to the computer's TCP/IP address), the port number on that computer, and the resource to be first accessed. When WWW is part of a URL, this name is registered with a nameserver that interprets this WWW URL address (such as www.oracle.com) into the computer's name (known as a hostname) and the port for the listener.

TCP/IP— A common computer network, which also supports the World Wide Web.


NOTE

HTTP (Hypertext Transfer Protocol)— The communication layer between the Web browser and the HTTP or Web listener. HTTP is a transmission protocol that works over TCP/IP and the Internet.


NOTE

HTML (Hypertext Markup Language)— Used to build Web pages by specifying various display attributes, accessing computer files for display, and using tags. These tags tell the Web browser whether to bold, highlight, link, access computer files, and so on.


Another method for creating and processing Web requests is through a CGI (Common Gateway Interface) program, illustrated in Figure 8.2. In Figure 8.2, where a computer system file containing HTML is being accessed, the CGI method executes a program that can be written in almost any language and produces files (in HTML format, or referenced by an HTML-formatted file) that are returned to the Web browser. This method consumes quite a bit more resources than the one shown in Figure 8.1 because a program has to start, execute, possibly log in to a database, and perform some work there (such as data extraction) before it can return anything to the Web browser. In addition, each Web listener request starts a new program. You can see that if this method is employed on a popular Web site, it could create quite a load on the computer system.

Figure 8.2. Web browser accessing a CGI interface.


NOTE

CGI (Common Gateway Interface)— Usually a program being accessed instead of a computer file, as in Figure 8.2.


Applets are Java programs that are parts of Web pages. They are downloaded through the listener to a compliant Web browser (Netscape and Microsoft Explorer both support applets) and are executed on the client machine. Servlets are host-based Java programs that build dynamic Web pages that are then passed back to the Web browser.

A series of servlets remains running to handle requests from the Java Web server. Two versions of Java Database Connectivity (JDBC) exist—thin JDBC and thick JDBC.

  • Thin JDBC is used by applets and provides database connectivity for a particular client session.

  • Thick JDBC is used to maintain connectivity for the duration of the servlet process.

Both kinds of JDBC connect to Oracle9i via Net8. Figure 8.3 illustrates how the servlets work and how the applets work. The applet is downloaded to the client's Web browser via a Web page; it then connects and processes Java requests from the client's computer. Servlets maintain connectivity and are designed to be shared across requests coming through the Java Web server.

Figure 8.3. CGI interface with applets versus servlets.


The HTTP or Web listener can be one of many products, such as Microsoft IIS, Netscape FastTrack, or Oracle iAS (internet Application Server). Each complete URL contains many parts. The first part up to the first / is the machine address. Somewhere along the way, this WWW name gets relayed back to a host and domain name and a TCP/IP address and port number for a particular computer. On that computer is a listener process waiting for requests for that computer. What follows the first / is the virtual address.

Figure 8.4 shows how that virtual address relates to a physical location on the particular computer. Whatever follows the final / is what is accessed, started, or executed on that computer. If nothing follows the final /, a default, such as Index.html, is used.

Figure 8.4. Web Virtual Directory mappings.


Several different kinds of URLs exist. An HTTP URL is used to connect with a Web server that handles HTML documents (Web pages)—for example, http://www.quest.com/, which accesses the Quest Web server and returns the HTML document Index.HTML. Other URLs are used for file transfer, such as ftp://www.some_ftp_server.com/, which uploads or downloads files using the FTP program and protocol. In addition, many kinds of servers are available, each with its own protocol, such as Usenet (uses the News URL), and so on.

URLs can also contain parameters. Parameters begin following a ?, where the parameters are then named and values passed. A URL with parameters might look like this:

http://yourdomain.com/virtual_path_for_plsqlcart/stored_proc?param=1

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.175.113