Documentation Archive Developer
Search
PATH  Documentation > WebObjects 4.5 > WebObjects Developer's Guide


Table of Contents Previous Section

Determining the Request Type

The first step in the request-response cycle is to determine which request handler should handle the request. A cycle of the request-response loop begins when the WOAdaptor receives an incoming HTTP request. The adaptor object packages this request in a WORequest object and forwards this object to the application object in a dispatchRequest: message. The application object determines which WORequestHandler should handle the request with handlerForRequest:. (The request handler key in the request URL specifies which WORequestHandler should be used.)

If the request is the first one for a given user session, the request URL looks like the URL shown in Figure 20.

Figure 20. URL to Access a WebObjects Application

This URL does not have a request handler key. In this case, WOApplication uses the default request handler (returned by its defaultRequestHandler method). Unless you override the default using setDefaultRequestHandler:, the default request handler is WOComponentRequestHandler.

After the initial request, subsequent URLs look like the one shown in Figure 21.

Figure 21. WebObjects URL in Existing Session

This URL contains a request handler key immediately following the application name. WOApplication maintains a dictionary of WORequestHandlers. It uses the request handler key to look up which request handler to use. By default, "wo" is the request handler key specifying component actions, and "wa" specifies direct actions (which are handled by the WODirectActionRequestHandler object).

Once the application has determined which request handler to use, it sends that handler a handleRequest: message. From this point forward, what happens during the request-response loop is highly dependent on which type of request is being processed: a component action request, or a direct action request. The rest of this section looks at each type of request handler in detail.

Table of Contents Next Section