Application URLs

An application URL with a specific format is used to make an initial request to a WebObjects application. The host identified in the URL receives the request and passes it to the WebObjects adaptor identified in the URL. The adaptor receives the request, repackages it into a standard format, and sends it to the appropriate WebObjects application instance. This section describes the format of this URL so that you can connect directly to an application instance from a browser. This URL is very useful for both development and deployment.

Types of WebObjects URLs

There are three ways to connect to an application instance:

Format of WebObjects URLs

The format of a WebObjects application URL depends on the type of URL connection.

The URL format for an application in direct connect mode is:

http:// host:port/ cgi-bin / WebObjects / App[.woa [/ key /  ...]]

The URL format for an application in deployment mode is:

http:// host / cgi-bin / WebObjects / App [.woa [/ instance [/ key /...]]]

The URL format for an application in development mode is:

http: // host / cgi-bin / WebObjects / App.woa / -port [/ key / ... ]

Table 7-1 describes the variables in these URL formats.

Table 7-1  WebObjects application URL variables

Variable

Description

host

The host name of your computer or localhost.

port

The port number. If you are connecting directly to the application instance, include the port number.

cgi-bin

The cgi-bin directory of your server, usually cgi-bin or Scripts.

WebObjects

The name of the CGI adaptor, usually WebObjects.

App

The application name. The WOApplicationBaseURL property described in WebObjects Application Properties Reference specifies the path to the application.

instance

The application instance number.

key

The request handler key. This key specifies which WORequestHandler object should be used to process the request and is typically either wo (the component request handler) or wa (the direct action request handler).

...

Information specific to the request handler. Each WORequestHandler uses a different format for the rest of the URL. See Table 7-2 for component actions and Table 7-3 for direct actions.

The two main request handlers are WOComponentRequestHandler and WODirectActionRequestHandler for component action URLs. The rest of the format for component action URLs is:

componentName / sessionID / elementID

Table 7-2 describes the variables in a component action URL.

Table 7-2  Component action URL variables

Variable

Description

componentName

Name of the WOComponent class.

sessionID

The session identifier.

elementID

The element identifier.

WODirectActionRequestHandler handles direct actions. The rest of the format for direct action URLs is:

[ actionClass | actionName | actionClass / actionName ][? key = value & key = value .....]

Table 7-3 describes the variables in a direct action URL.

Table 7-3  Direct action URL variables

Variable

Description

actionClass

The name of the WODirectAction class in which the action method is defined. If actionClass is not specified, class DirectAction is assumed.

actionName

The name of the action method. If actionName is not specified, the defaultAction method on actionClass is assumed.

key

The key portion of a key-value pair in the URL query string

value

The value portion of a key-value pair in the URL query string.