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(..)
Code Block |
---|
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(..)
Code Block |
---|
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(..)
Code Block |
---|
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(..)
Code Block |
---|
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(..)
Code Block |
---|
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(..)
Code Block |
---|
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(..)
Code Block |
---|
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(..)
Code Block |
---|
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 |
|