Components
To write a WebObjects application, you create components and connect them together. A component is a page or portion of a page that has both HTML content and behavior. Each component is located in its own directory named Component.wo and generally contains these files:
- An HTML template (Component.html) that specifies how the page looks.
- A script file (Component.wos) that defines the component's attributes (variables) and implements its behavior in WebScript.
- A declarations file (Component.wod) that binds the dynamic elements of the template to the script's variables and actions.
- If necessary, any images or other resources the component uses.
The first page of a WebObjects application is usually named Main.wo. When users start a session with a WebObjects application, they can specify the name of the first page, but such a practice is uncommon. If no page is specified, WebObjects applications look for the Main.wo component.
Note: Not all components represent an entire page. You can nest small, reusable components inside a component representing a whole page. For more information, see the "Creating Reusable Components" chapter.
Table of Contents Next Section