• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Webobjects-dev Digest, Vol 6, Issue 452
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Webobjects-dev Digest, Vol 6, Issue 452


  • Subject: Re: Webobjects-dev Digest, Vol 6, Issue 452
  • From: Johnny Miller <email@hidden>
  • Date: Thu, 14 May 2009 09:26:26 -1000

Hi Dave,

You can also use WOContext's componentActionURL and directActionURLForActionNamed.

I do something that I know is really ugly all the time but I have not thought of a smarter way to do this.

Example of my ugliness:

public String homeLink() {
String link = "/";
if(! app().isDeployed()) { // TEST TO SEE IF PROPERTIES FILE SAYS I'M DEPLOYED
link = context().directActionURLForActionNamed("default", null);
}
return link;
}


I'll then bind this method to a wo:link's href attribute.

This is a basic example, but I build out all my links like this so that when in production the app prints pretty search engine friendly links which I'll return to WO links via apache's mod_rewrite. When in development and not using mod_rewrite I get the standard links.

Right now I only do this for Direct Action applications.

Is there a smarter/pratical way?

Jon



On May 14, 2009, at 2:22 PM, Guido Neitzer wrote:

Does WOActionURL help you?

Perfect! And if I define secure=false, then I get the full URL and not just the /cgi-bin/... portion.

Thanks Guido!

Dave

_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Job available @ Lausanne, Switzerland
  • Next by Date: [OT] Help needed for wocommunity.org
  • Previous by thread: Job available @ Lausanne, Switzerland
  • Next by thread: [OT] Help needed for wocommunity.org
  • Index(es):
    • Date
    • Thread