WebObjects 4: Changing the default page in a WebObjects application

This article describes how to change the default page of a WebObjects application from the page defined by Main.wo to the page or WOComponent of your choice.

This article has been archived and is no longer updated by Apple.

Introduction

By default, a WebObjects app opens to a page named "Main". Any reference to "Main" in a hyperlink, action method, or dynamic element directs users to this page named "Main". Sometimes WebObjects developers wish to change this "default" page to a different WOComponent.

You can change this default page by overriding a method in your WOApplication subclass. In Objective C, the method is:

The source code examples below demonstrate how to implement the change. Please note that if you override pageWithName:inContext: in this way, all references to "Main" in your application will now be references to "DiffDefPage". Users are no longer able to access the Main.wo component.