TOPIC Q: I'm using WebObjects 4.5 on a system using virtual domains; a server named "ecom3.apple.com" might handle requests directed to "store.webobjects.com". However, when I schedule one of my application instances to start refusing new requests and a session is redirected to another server, for the rest of the session the actual server name (for example, "ecom3.apple.com") appears in the URL instead of my virtual domain name. How can I stop this from happening? DISCUSSION A: This issue occurs because WebObjects applications use HTTP 301 messages to redirect sessions when they are set to refuse new requests. The web browser then detects the actual hostname of the new server based on the partial URL returned by WebObjects. You can work around this issue by having WebObjects return a full URL in this instance instead of a partial one. This requires overriding a private method in WOApplication. The method is -_newLocationForRequest: , and the new version should return the URL that the redirect will use. Your code might look like this:
- (NSString*)_newLocationForRequest:(WORequest*)aRequest {
IMPORTANT: Please note that the _newLocationForRequest: method is private, and its use is not supported by Apple. This method is subject to change or removal in future WebObjects releases. Use this method at your own risk. |
Document Information | |
Product Area: | WebObjects |
Category: | WebObjects 4.5 |
Sub Category: | Deployment |
Copyright © 2000 Apple Computer, Inc. All rights reserved.