Table of Contents
Previous Section
To connect a WebObjects application to the Web, you need the following:
- An HTTP server. You can use any HTTP server that uses the Common Gateway Interface (CGI) or the Netscape Server API (NSAPI).
- A WebObjects adaptor. A WebObjects adaptor connects WebObjects applications to the Web by acting as an intermediary between web applications and HTTP servers. Adaptors insulate applications from server interfaces by handling all server communication. Simply by switching adaptors, you use a different HTTP server and a different server interface without modifying application code.
- WebObjects provides an adaptor for servers that use the Common Gateway Interface (CGI) and an adaptor for the Netscape Commerce Server that uses the Netscape Server API (NSAPI).
- A WebObjects application executable. An application executable receives incoming requests and responds to them, usually by returning a dynamically generated HTML page. An executable can be a compiled application linked with the WebObjects library, or it can be one of the two default WebObjects application executables: DefaultApp or EOFDefaultApp.
- If the application doesn't contain any compiled code, you use a default application. Instead of building your own executable, you implement all the application logic in script files. The default applications use these scripts to respond to requests.
A typical WebObjects application contains the following ingredients:
- Components that specify the content, presentation, and behavior of the application's pages
- An optional application script that creates and manages application-wide resources
- Optional compiled code that implements custom data and logic
- WebObjects classes that provide an infrastructure for the web application
You write the following parts of a WebObjects application:
- Components consisting of HTML templates, script files, and declarations files
- An optional application script
- Optional compiled code
To run a WebObjects application, you open a URL with the following form:
Figure 14. URL to Start a WebObjects Application
Behind the scenes of a running WebObjects application, the application enters a request-response loop each time it receives a request. In the request-response loop, a WebObjects application uses the page-to-component mappings defined in declarations files to:
- Prepare for the request.
- Invoke an action.
- Generate a response page.