Version 24.1 by Andrew Lindesay on 2008/07/05 01:32

Hide last authors
Andrew Lindesay 20.1 1 = WOContext =
Andrew Lindesay 3.1 2
3 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.
4
Andrew Lindesay 20.1 5 == Example URLs ==
Andrew Lindesay 3.1 6
Andrew Lindesay 20.1 7 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.
Andrew Lindesay 3.1 8
Andrew Lindesay 24.1 9 === Development Mode ===
10
11 This is the case where the application is being developed in, for example, Eclipse;
12
Andrew Lindesay 20.1 13 {{code}}
14 completeURLWithRequestHandlerKey(
15 WOApplication.application().directActionRequestHandlerKey(),
16 "default",
17 "a=b",
18 context().request().isSecure(),
19 0);
Andrew Lindesay 3.1 20
Andrew Lindesay 20.1 21 {{/code}}
22
Andrew Lindesay 24.1 23 |=Session|=Deployment|=URL
24 |Y|Dev|##http:~/~/hebe.local:54791/cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b##
25 |N|Dev|##http:~/~/hebe.local:54791/cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b##
Andrew Lindesay 20.1 26
27 {{code}}
28 completeURLWithRequestHandlerKey(
29 "123",
30 WOApplication.application().directActionRequestHandlerKey(),
31 "default",
32 "a=b",
33 context().request().isSecure(),
34 0);
35
36 {{/code}}
37
Andrew Lindesay 24.1 38 |=Session|=Deployment|=URL
39 |Y|Dev|##http:~/~/hebe.local:54791/cgi-bin/WebObjects/TestUrlCreation.woa/123/wa/default?a=b##
40 |N|Dev|##http:~/~/hebe.local:54791/cgi-bin/WebObjects/TestUrlCreation.woa/123/wa/default?a=b##
Andrew Lindesay 20.1 41
Andrew Lindesay 24.1 42 |Method|context().componentActionURL()
43 |Session|##/cgi-bin/WebObjects/TestUrlCreation.woa/wo/V4N99Ub2Zjavh6V3tvcEQM/0.15##
44 |No Session|##/cgi-bin/WebObjects/TestUrlCreation.woa/wo/zBXy58rwSW6aU1mTXVk9uw/0.11##
Andrew Lindesay 20.1 45
Andrew Lindesay 24.1 46 |Method|componentActionURL(WOApplication.application().ajaxRequestHandlerKey())
47 |Session|##/cgi-bin/WebObjects/TestUrlCreation.woa/ja/V4N99Ub2Zjavh6V3tvcEQM/0.11##
48 |No Session|##/cgi-bin/WebObjects/TestUrlCreation.woa/ja/zBXy58rwSW6aU1mTXVk9uw/0.13##
Andrew Lindesay 20.1 49
Andrew Lindesay 24.1 50 |Method|componentActionURL(
Andrew Lindesay 20.1 51 WOApplication.application().ajaxRequestHandlerKey(),
52 context().request().isSecure())
Andrew Lindesay 24.1 53 |Session|##/cgi-bin/WebObjects/TestUrlCreation.woa/ja/V4N99Ub2Zjavh6V3tvcEQM/0.13##
54 |No Session|##/cgi-bin/WebObjects/TestUrlCreation.woa/ja/zBXy58rwSW6aU1mTXVk9uw/0.15##
Andrew Lindesay 20.1 55
Andrew Lindesay 24.1 56 |Method|directActionURLForActionNamed(
Andrew Lindesay 20.1 57 "default",
Andrew Lindesay 24.1 58 new NSDictionary<String,Object>(new Object[[]] {"b"}, new String[[]] {"a"}),
Andrew Lindesay 20.1 59 context().request().isSecure(),
60 true);
Andrew Lindesay 24.1 61 |Session|##/cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b&amp;wosid=V4N99Ub2Zjavh6V3tvcEQM##
62 |No Session|##/cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b##
Andrew Lindesay 20.1 63
Andrew Lindesay 24.1 64 |Method|directActionURLForActionNamed(
Andrew Lindesay 20.1 65 "default",
Andrew Lindesay 24.1 66 new NSDictionary<String,Object>(new Object[[]] {"b"}, new String[[]] {"a"}))
67 |Session|##/cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b&wosid=V4N99Ub2Zjavh6V3tvcEQM##
68 |No Session|##/cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b##
Andrew Lindesay 20.1 69
Andrew Lindesay 24.1 70 |Method|urlWithRequestHandlerKey(
Andrew Lindesay 20.1 71 WOApplication.application().ajaxRequestHandlerKey(),
72 "default",
73 "a=b")
Andrew Lindesay 24.1 74 |Session|##/cgi-bin/WebObjects/TestUrlCreation.woa/ja/default?a=b##
75 |No Session|##/cgi-bin/WebObjects/TestUrlCreation.woa/ja/default?a=b##