Version 23.1 by Andrew Lindesay on 2008/07/05 01:37

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 20.1 9 {{code}}
10 completeURLWithRequestHandlerKey(
11 WOApplication.application().directActionRequestHandlerKey(),
12 "default",
13 "a=b",
14 context().request().isSecure(),
15 0);
Andrew Lindesay 3.1 16
Andrew Lindesay 20.1 17 {{/code}}
18
19 |=Session|=Deployment|=Secure|=Generated URL
20 |Y|Dev|N|##http:~/~/hebe.local:54791/cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b##
21 |N|Dev|N|##http:~/~/hebe.local:54791/cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b##
22
23 {{code}}
24 completeURLWithRequestHandlerKey(
25 "123",
26 WOApplication.application().directActionRequestHandlerKey(),
27 "default",
28 "a=b",
29 context().request().isSecure(),
30 0);
31
32 {{/code}}
33
34 |=Session|=Deployment|=Secure|=Generated URL
35 |Y|Dev|N|##http:~/~/hebe.local:54791/cgi-bin/WebObjects/TestUrlCreation.woa/123/wa/default?a=b##
36 |N|Dev|N|##http:~/~/hebe.local:54791/cgi-bin/WebObjects/TestUrlCreation.woa/123/wa/default?a=b##
37
38 {{code}}
Andrew Lindesay 22.1 39 context().componentActionURL()
Andrew Lindesay 20.1 40 {{/code}}
41
42 |=Session|=Deployment|=Secure|=Generated URL
43 |Y|Dev|N|##/cgi-bin/WebObjects/TestUrlCreation.woa/wo/V4N99Ub2Zjavh6V3tvcEQM/0.15##
44 |N|Dev|N|##/cgi-bin/WebObjects/TestUrlCreation.woa/wo/zBXy58rwSW6aU1mTXVk9uw/0.11##
45
46 {{code}}
47 componentActionURL(WOApplication.application().ajaxRequestHandlerKey())
48 {{/code}}
49
50 |=Session|=Deployment|=Secure|=Generated URL
51 |Y|Dev|N|##/cgi-bin/WebObjects/TestUrlCreation.woa/ja/V4N99Ub2Zjavh6V3tvcEQM/0.11##
52 |N|Dev|N|##/cgi-bin/WebObjects/TestUrlCreation.woa/ja/zBXy58rwSW6aU1mTXVk9uw/0.13##
53
54 {{code}}
55 componentActionURL(
56 WOApplication.application().ajaxRequestHandlerKey(),
57 context().request().isSecure())
58 {{/code}}
59
60 |=Session|=Deployment|=Secure|=Generated URL
61 |Y|Dev|N|##/cgi-bin/WebObjects/TestUrlCreation.woa/ja/V4N99Ub2Zjavh6V3tvcEQM/0.13##
62 |N|Dev|N|##/cgi-bin/WebObjects/TestUrlCreation.woa/ja/zBXy58rwSW6aU1mTXVk9uw/0.15##
63
64 {{code}}
65 directActionURLForActionNamed(
66 "default",
67 new NSDictionary<String,Object>(new Object[] {"b"}, new String[] {"a"}),
68 context().request().isSecure(),
69 true);
70 {{/code}}
71
72 |=Session|=Deployment|=Secure|=Generated URL
Andrew Lindesay 22.1 73 |Y|Dev|N|##/cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b&amp;wosid=V4N99Ub2Zjavh6V3tvcEQM##
Andrew Lindesay 20.1 74 |N|Dev|N|##/cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b##
75
76 {{code}}
77 directActionURLForActionNamed(
78 "default",
79 new NSDictionary<String,Object>(new Object[] {"b"}, new String[] {"a"}))
80 {{/code}}
81
82 |=Session|=Deployment|=Secure|=Generated URL
83 |Y|Dev|N|##/cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b&wosid=V4N99Ub2Zjavh6V3tvcEQM##
84 |N|Dev|N|##/cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b##
85
86 {{code}}
87 urlWithRequestHandlerKey(
88 WOApplication.application().ajaxRequestHandlerKey(),
89 "default",
90 "a=b")
91 {{/code}}
92
93 |=Session|=Deployment|=Secure|=Generated URL
94 |Y|Dev|N|##/cgi-bin/WebObjects/TestUrlCreation.woa/ja/default?a=b##
95 |N|Dev|N|##/cgi-bin/WebObjects/TestUrlCreation.woa/ja/default?a=b##