Write For Us

Oracle APEX Architecture and Listener Options Session 3 of 7: The HTTP Request Response Cycle

Sponsored Post Vitamin D2 Canada Persia
597 Views
Published
To begin with, the HTTP request-response cycle. HTTP is a stateless protocol. You issue an HTTP request using typically a post or get method.

I'll go to the most basic get method here. This shouldn't be the URL. The URL doesn't have to come from a browser of course, it can come from pretty much anything, but the URL just doesn't get request. It contacts the web listener sending it a message requesting a page. The web listener does whatever is necessary and returns the page usually in the form of HTML but not necessarily.

To break down what a URL actually is. You specify a protocol then delimiter colon, slash, slash (://), username delimiter colon (:) and the password and an at symbol (@), host.domain delimiter colon (:), port number delimiter a slash (/), then a path delimited with slash (/), filename with a dot (.) has a delimiter and then extension followed by a question mark (?) and then a set of parameters, parameter=value pass. Your entire URL may have all of these elements. It usually won't.

For example, a typical URL - I have on the slide just that. FTP - if I were to launch my browser and give it an FTP, type URL FTP://. I'll log on. What might my log on be? Perhaps give it a username, Oracle. Password, Oracle. Not working high security here, @ and then my server .168.192.168.56.101 and see what we've got.

I didn't specify the entire URL at that point, just part of it. If we look down here, check my status line in the bottom. If I hover over hello world there, you're seeing the status line at the bottom of the browser FTP://oracle:oracle is the username and password, @, the host name and then specifying a file helloworld.txt. Clicking on that, we get "message is sent" and back comes the content of the file.

That's all a URL is. You issue a URL, the client then hangs until the server side returns the page of HTML or whatever it may be. That will be a fairly basic URL.

In the APEX environment your URL is more likely going to be of this form.

You'll be at the form http://machine, then a port typically 8080, then the path probably APEX or it could be something else, and then the / and then f and the question mark (?). What's that - the f and the question mark? We're breaking it down again.

An example, I'll go to http:// and the destination I'm going to go to, just at this point, one of Oracle's demonstration sites. We could go to APEX.oracle.com. I happen to know this listener is listening on port 80, the virtual path is being configured is pls/otn. This is part of the Oracle Technology Network. And then f as a filename. Remember after the filename, we can have a question mark (?) and the parameter string. The parameter string I will give it is p=31517. Machine name, port, path, filename f, parameter string p=31517. Send that URL off and we get back a page for a demonstration APEX application.

What actually happened when we ran that? The web listener on the other side received the HTTP request and path it. It looks at that path pls/otn and the web listener, whatever it is, maps that onto something else. In the case of my FTP URL, it maps it onto a filename and copied it back. In the case of an APEX Listener, that gets mapped onto a call to run a PL/SQL procedure. Which procedure?

The procedure called f, which is perhaps not the most helpful procedure but the procedure called f. What is f?

On any database where APEX being stored - if I select owner and object 5 from DBA objects where object name = f, this does need to be in quotes ("), we see there's a public synonym and if we investigate further we see that's mapped onto that procedure. Now we know that f in this state is not a file name, it's a PL/SQL procedure. And what is it? That's the procedure.

This is the procedure, the f procedure, this is the heart of APEX. You invoke the procedure with optionally one or more parameters. I pass through one parameter which is p equals (=) and I gave it p=31517 and that is the page identifier. You request a page by name or by number and there are few other extras you're going to add on to the p arguments which should be subsession identifier, a few other parameters you can drive it with, and in some circumstances you'll set extra ones.

That's what an APEX application is. It's a URL that invokes the f procedure, the f procedure then generates a page of HTML which is sent back to you.

How is that page generated? That becomes the next major point of discussion.
Category
Success
Sign in or sign up to post comments.
Be the first to comment