Child pages
  • Development-UrlCreation

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

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);

B - completeURLWithRequestHandlerKey(..)

Code Block
completeURLWithRequestHandlerKey(
  "123",
  WOApplication.application().directActionRequestHandlerKey(),
  "default",
  "a=b",
  context().request().isSecure(),
  0);

C - componentActionURL(..)

Code Block
componentActionURL()

Session

Deployment

Secure

Generated URL

Y

Dev

N

/cgi-bin/WebObjects/TestUrlCreation.woa/wo/V4N99Ub2Zjavh6V3tvcEQM/0.15

N

Dev

N

/cgi-bin/WebObjects/TestUrlCreation.woa/wo/zBXy58rwSW6aU1mTXVk9uw/0.11

Y

wotaskd

N

/cgi-bin/WebObjects/UT.woa/1/wo/KMU4YqMibJ4p8XP0biSYDw/0.15

N

wotaskd

N

/cgi-bin/WebObjects/UT.woa/1/wo/TxKR0vkbs8Z0tGsUfrGlQ0/0.15

Y

wotaskd

Y

/cgi-bin/WebObjects/UT.woa/1/wo/3bmlqBLMVGzjmuW1wTPTZw/0.15

N

wotaskd

Y

/cgi-bin/WebObjects/UT.woa/1/wo/z3uRsfT27ZsKLvlcS4Bkx0/0.15

D - componentActionURL(..)

Code Block
componentActionURL(WOApplication.application().ajaxRequestHandlerKey())

Session

Deployment

Secure

Generated URL

Y

Dev

N

/cgi-bin/WebObjects/TestUrlCreation.woa/ja/V4N99Ub2Zjavh6V3tvcEQM/0.11

N

Dev

N

/cgi-bin/WebObjects/TestUrlCreation.woa/ja/zBXy58rwSW6aU1mTXVk9uw/0.13

Y

wotaskd

N

/cgi-bin/WebObjects/UT.woa/1/ja/KMU4YqMibJ4p8XP0biSYDw/0.11

N

wotaskd

N

/cgi-bin/WebObjects/UT.woa/1/ja/TxKR0vkbs8Z0tGsUfrGlQ0/0.11

Y

wotaskd

Y

/cgi-bin/WebObjects/UT.woa/1/ja/3bmlqBLMVGzjmuW1wTPTZw/0.11

N

wotaskd

Y

/cgi-bin/WebObjects/UT.woa/1/ja/z3uRsfT27ZsKLvlcS4Bkx0/0.11

E - componentActionURL(..)

Code Block
componentActionURL(
  WOApplication.application().ajaxRequestHandlerKey(),
  context().request().isSecure())

Session

Deployment

Secure

Generated URL

Y

Dev

N

/cgi-bin/WebObjects/TestUrlCreation.woa/ja/V4N99Ub2Zjavh6V3tvcEQM/0.13

N

Dev

N

/cgi-bin/WebObjects/TestUrlCreation.woa/ja/zBXy58rwSW6aU1mTXVk9uw/0.15

Y

wotaskd

N

/cgi-bin/WebObjects/UT.woa/1/ja/KMU4YqMibJ4p8XP0biSYDw/0.13

N

wotaskd

N

/cgi-bin/WebObjects/UT.woa/1/ja/TxKR0vkbs8Z0tGsUfrGlQ0/0.13

Y

wotaskd

Y

/cgi-bin/WebObjects/UT.woa/1/ja/3bmlqBLMVGzjmuW1wTPTZw/0.13

N

wotaskd

Y

/cgi-bin/WebObjects/UT.woa/1/ja/z3uRsfT27ZsKLvlcS4Bkx0/0.13

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

/cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b&wosid=V4N99Ub2Zjavh6V3tvcEQM

N

Dev

N

/cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b

Y

wotaskd

N

/cgi-bin/WebObjects/UT.woa/1/wa/default?a=b&wosid=KMU4YqMibJ4p8XP0biSYDw

N

wotaskd

N

/cgi-bin/WebObjects/UT.woa/wa/default?a=b

Y

wotaskd

Y

/cgi-bin/WebObjects/UT.woa/1/wa/default?a=b&wosid=3bmlqBLMVGzjmuW1wTPTZw

N

wotaskd

Y

/cgi-bin/WebObjects/UT.woa/wa/default?a=b

G - directActionURLForActionNamed(..)

Code Block
directActionURLForActionNamed(
  "default",
  new NSDictionary<String,Object>(new Object[] {"b"}, new String[] {"a"}))

Session

Deployment

Secure

Generated URL

Y

Dev

N

/cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b&wosid=V4N99Ub2Zjavh6V3tvcEQM

N

Dev

N

/cgi-bin/WebObjects/TestUrlCreation.woa/wa/default?a=b

Y

wotaskd

N

/cgi-bin/WebObjects/UT.woa/1/wa/default?a=b&wosid=KMU4YqMibJ4p8XP0biSYDw

N

wotaskd

N

/cgi-bin/WebObjects/UT.woa/wa/default?a=b

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

/cgi-bin/WebObjects/TestUrlCreation.woa/ja/default?a=b

N

Dev

N

/cgi-bin/WebObjects/TestUrlCreation.woa/ja/default?a=b

Y

wotaskd

N

/cgi-bin/WebObjects/UT.woa/1/ja/default?a=b

N

wotaskd

N

/cgi-bin/WebObjects/UT.woa/ja/default?a=b

Y

wotaskd

Y

/cgi-bin/WebObjects/UT.woa/1/ja/default?a=b

N

wotaskd

Y

/cgi-bin/WebObjects/UT.woa/ja/default?a=b