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:
If a user enters invalid data in a form, you can route the request to a page displaying an error message.
If your application requires users to log in, you can route first-time connections to a login page.
You can have requests routed to different pages depending upon which push button the user clicked on, or which selection was made in a list.
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 VA Smalltalk 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.
Last modified date: 01/29/2015