WebApplictions-Development-UrlCreation
Version 24.1 by Andrew Lindesay on 2008/07/05 01:32
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.
Development Mode
This is the case where the application is being developed in, for example, Eclipse;
completeURLWithRequestHandlerKey(
WOApplication.application().directActionRequestHandlerKey(),
"default",
"a=b",
context().request().isSecure(),
0);
WOApplication.application().directActionRequestHandlerKey(),
"default",
"a=b",
context().request().isSecure(),
0);
Session | Deployment | URL |
---|---|---|
Y | Dev | http://hebe.local:54791/cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b |
N | Dev | http://hebe.local:54791/cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b |
completeURLWithRequestHandlerKey(
"123",
WOApplication.application().directActionRequestHandlerKey(),
"default",
"a=b",
context().request().isSecure(),
0);
"123",
WOApplication.application().directActionRequestHandlerKey(),
"default",
"a=b",
context().request().isSecure(),
0);
Session | Deployment | URL |
---|---|---|
Y | Dev | http://hebe.local:54791/cgi-bin/WebObjects/TestUrlCreation.woa/123/wa/default?a=b |
N | Dev | http://hebe.local:54791/cgi-bin/WebObjects/TestUrlCreation.woa/123/wa/default?a=b |
Method | context().componentActionURL() |
Session | /cgi-bin/WebObjects/TestUrlCreation.woa/wo/V4N99Ub2Zjavh6V3tvcEQM/0.15 |
No Session | /cgi-bin/WebObjects/TestUrlCreation.woa/wo/zBXy58rwSW6aU1mTXVk9uw/0.11 |
Method | componentActionURL(WOApplication.application().ajaxRequestHandlerKey()) |
Session | /cgi-bin/WebObjects/TestUrlCreation.woa/ja/V4N99Ub2Zjavh6V3tvcEQM/0.11 |
No Session | /cgi-bin/WebObjects/TestUrlCreation.woa/ja/zBXy58rwSW6aU1mTXVk9uw/0.13 |
Method | componentActionURL( WOApplication.application().ajaxRequestHandlerKey(), context().request().isSecure()) |
Session | /cgi-bin/WebObjects/TestUrlCreation.woa/ja/V4N99Ub2Zjavh6V3tvcEQM/0.13 |
No Session | /cgi-bin/WebObjects/TestUrlCreation.woa/ja/zBXy58rwSW6aU1mTXVk9uw/0.15 |
Method | directActionURLForActionNamed( "default", new NSDictionary<String,Object>(new ObjectDevelopment-UrlCreation {"b"}, new StringDevelopment-UrlCreation {"a"}), context().request().isSecure(), true); |
Session | /cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b&wosid=V4N99Ub2Zjavh6V3tvcEQM |
No Session | /cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b |
Method | directActionURLForActionNamed( "default", new NSDictionary<String,Object>(new ObjectDevelopment-UrlCreation {"b"}, new StringDevelopment-UrlCreation {"a"})) |
Session | /cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b&wosid=V4N99Ub2Zjavh6V3tvcEQM |
No Session | /cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b |
Method | urlWithRequestHandlerKey( WOApplication.application().ajaxRequestHandlerKey(), "default", "a=b") |
Session | /cgi-bin/WebObjects/TestUrlCreation.woa/ja/default?a=b |
No Session | /cgi-bin/WebObjects/TestUrlCreation.woa/ja/default?a=b |