Web Connection User's Guide

Routing requests to different pages

In some applications, you might want to conditionally route an incoming request to different pages in different situations. For example:

The Page Wrapper part provides a way for you to do this. A Page Wrapper part represents another Web Connection part. If you want to route incoming requests to a different part, add a Page Wrapper part for each Web Connection part you want to route requests to. In the settings for Page Wrapper, specify the VisualAge part name of the Web Connection part represented by the Page Wrapper.

Once you have set up the Page Wrapper part to represent another page, you can route the current request to that page by connecting to the transferRequest action of Page Wrapper. When transferRequest executes, the current request is immediately transferred to the specified part. The part containing the Page Wrapper does not generate HTML if the request is transferred to a different part.

You can also use the transferRequestWith: action to transfer an object along with the request. You can specify any Smalltalk object as the parameter for transferRequestWith:. This makes it possible to supply additional information about the request as you transfer it. For example, if you are transferring the request to an error page, you might want to also specify an error string that describes the error. The page receiving the request can access the transferred object through the transferredObject attribute of the CGI Link Request part.

If you transfer an incoming request to a different page through a Page Wrapper, the current page generates no HTML.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]