The Structure of a Direct to Web Project
A Direct to Web project has a similar structure to other WebObjects application projects. A newly created project contains three components:
- Main.wo is the main component, representing the login page of the application.
- Header.wo is a reusable component that is inserted at the beginning of each page in the application (other than Main). It contains some control buttons that are displayed at the top of each page. If you choose, you can add text or other elements to the Header component.
- Footer.wo is a reusable component that is inserted at the end of each page in the application. By default, it is blank; you can add elements to it if you choose.
As you run your application, Direct to Web creates additional pages, using information in your model file and settings specified in the WebAssistant. These pages do not show up as components in your project. Rather, Direct to Web creates them dynamically using a set of reusable components in the Direct to Web framework. However, you have the option of saving any page as a component. When you do that, you are then able to modify the component just as you would with any other WebObjects component. See See Generating Components for more information.
In your project's Classes suitcase, you'll see a Java file for each of the components, as well as the Session and Application objects. You can add code to any of these files to extend their functionality. See See Modifying Your Application's Code for more information on the Direct to Web API.
The Resources suitcase contains the model file you specified when you created the project (in this example, Movies.eomodeld ). It also contains user.d2wmodel , which is used to store the preferences you have changed using the WebAssistant (you should never need to edit this file directly).