Mailing List webobjects-dev@wocommunity.org Message #66
From: Stefan Gärtner <webobjects-dev@wocommunity.org>
Subject: Re: [WO-DEV] Stupid me but how do I generate a fully qualified direct action url for sending out via mail?
Date: Wed, 17 Feb 2021 08:33:36 +0100
To: WebObjects & WOnder Development <webobjects-dev@wocommunity.org>
Two important questions should be considered:

  • Do you generate the URL inside of a request-response cycle or possibly also inside of a background task?
    • If during a request, WOContext.directActionURLForActionNamed works fine, as written by René and Ramsey. This works because the WOContext takes the URL used in the HTTP WORequest.
    • Else:
  • Is the host, which the app is running on, the one directly accessed by users via HTTP?
    • If yes, you might be able to use ERXConfigurationManager.defaultManager().hostName() as suggested by Jesse (it uses InetAddress.getLocalHost().getHostName() internally)
    • Else:
  • Just define a configuration property containing the base URL (can certainly be specified per environment) as written by Paul.

Best regards,
Stefan


Am 16.02.2021 um 15:39 schrieb Markus Ruggiero (rucotec) <webobjects-dev@wocommunity.org>:

The subject line already says all

Thanks

Markus Ruggiero

rucotec GmbH                        web https://rucotec.ch
Steinenvorstadt 79                email markus.ruggiero@rucotec.ch
4051 Basel / Switzerland         mobile +41 79 508 4701










Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to Listmaster