WOContext
The WOContext
object is used to shepherd a request through the application and then back out to the user. It is also responsible for creation of URL's within the application server. So as the the response is being generated, the application will ask the context to generate URLs back into itself.
Example URLs
The WOContext
has a number of methods on itself to generate URLs back into the application server. Here the author has tested the generation of those URLs so it can be seen what is created by each method under different usages. These examples have been produced with WebObjects 5.4.
A - completeURLWithRequestHandlerKey(..)
completeURLWithRequestHandlerKey( WOApplication.application().directActionRequestHandlerKey(), "default", "a=b", context().request().isSecure(), 0);
Session |
Deployment |
Secure |
Generated URL |
---|---|---|---|
Y |
Dev |
N |
{{ http://hebe.local:54791/cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b}} |
N |
Dev |
N |
{{ http://hebe.local:54791/cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b}} |
Y |
wotaskd |
N |
{{ http://server/cgi-bin/WebObjects/UT.woa/1/wa/default?a=b}} |
N |
wotaskd |
N |
{{ http://server/cgi-bin/WebObjects/UT.woa/wa/default?a=b}} |
Y |
wotaskd |
Y |
{{ https://server:443/cgi-bin/WebObjects/UT.woa/1/wa/default?a=b}} |
N |
wotaskd |
Y |
{{ https://server:443/cgi-bin/WebObjects/UT.woa/wa/default?a=b}} |
B - completeURLWithRequestHandlerKey(..)
completeURLWithRequestHandlerKey( "123", WOApplication.application().directActionRequestHandlerKey(), "default", "a=b", context().request().isSecure(), 0);
Session |
Deployment |
Secure |
Generated URL |
---|---|---|---|
Y |
Dev |
N |
{{ http://hebe.local:54791/cgi-bin/WebObjects/TestUrlCreation.woa/123/wa/default?a=b}} |
N |
Dev |
N |
{{ http://hebe.local:54791/cgi-bin/WebObjects/TestUrlCreation.woa/123/wa/default?a=b}} |
Y |
wotaskd |
N |
{{ http://server/cgi-bin/WebObjects/UT.woa/1/wa/default?a=b}} |
N |
wotaskd |
N |
{{ http://server/cgi-bin/WebObjects/UT.woa/1/wa/default?a=b}} |
Y |
wotaskd |
Y |
{{ https://server:443/cgi-bin/WebObjects/UT.woa/1/wa/default?a=b}} |
N |
wotaskd |
Y |
{{ https://server:443/cgi-bin/WebObjects/UT.woa/1/wa/default?a=b}} |
C - componentActionURL(..)
componentActionURL()
Session |
Deployment |
Secure |
Generated URL |
---|---|---|---|
Y |
Dev |
N |
|
N |
Dev |
N |
|
Y |
wotaskd |
N |
|
N |
wotaskd |
N |
|
Y |
wotaskd |
Y |
|
N |
wotaskd |
Y |
|
D - componentActionURL(..)
componentActionURL(WOApplication.application().ajaxRequestHandlerKey())
Session |
Deployment |
Secure |
Generated URL |
---|---|---|---|
Y |
Dev |
N |
|
N |
Dev |
N |
|
Y |
wotaskd |
N |
|
N |
wotaskd |
N |
|
Y |
wotaskd |
Y |
|
N |
wotaskd |
Y |
|
E - componentActionURL(..)
componentActionURL( WOApplication.application().ajaxRequestHandlerKey(), context().request().isSecure())
Session |
Deployment |
Secure |
Generated URL |
---|---|---|---|
Y |
Dev |
N |
|
N |
Dev |
N |
|
Y |
wotaskd |
N |
|
N |
wotaskd |
N |
|
Y |
wotaskd |
Y |
|
N |
wotaskd |
Y |
|
F - directActionURLForActionNamed(..)
directActionURLForActionNamed( "default", new NSDictionary<String,Object>(new Object[] {"b"}, new String[] {"a"}), context().request().isSecure(), true);
Session |
Deployment |
Secure |
Generated URL |
---|---|---|---|
Y |
Dev |
N |
|
N |
Dev |
N |
|
Y |
wotaskd |
N |
|
N |
wotaskd |
N |
|
Y |
wotaskd |
Y |
|
N |
wotaskd |
Y |
|
G - directActionURLForActionNamed(..)
directActionURLForActionNamed( "default", new NSDictionary<String,Object>(new Object[] {"b"}, new String[] {"a"}))
Session |
Deployment |
Secure |
Generated URL |
---|---|---|---|
Y |
Dev |
N |
|
N |
Dev |
N |
|
Y |
wotaskd |
N |
|
N |
wotaskd |
N |
|
Y |
wotaskd |
Y |
{{ http://server/cgi-bin/WebObjects/UT.woa/1/wa/default?a=b&wosid=3bmlqBLMVGzjmuW1wTPTZw}} |
N |
wotaskd |
Y |
{{ http://server/cgi-bin/WebObjects/UT.woa/wa/default?a=b}} |
H - urlWithRequestHandlerKey(..)
urlWithRequestHandlerKey( WOApplication.application().ajaxRequestHandlerKey(), "default", "a=b")
Session |
Deployment |
Secure |
Generated URL |
---|---|---|---|
Y |
Dev |
N |
|
N |
Dev |
N |
|
Y |
wotaskd |
N |
|
N |
wotaskd |
N |
|
Y |
wotaskd |
Y |
|
N |
wotaskd |
Y |
|