• 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: Generate DirectAction URL with instance number when there is nosession
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Generate DirectAction URL with instance number when there is nosession


  • Subject: Re: Generate DirectAction URL with instance number when there is nosession
  • From: Francis Labrie <email@hidden>
  • Date: Wed, 25 Jul 2007 14:58:56 -0400

Hi,

Frank Caputo wrote:

just try the following code:

NSMutableDictionary dict = new NSMutableDictionary();
String actionName = "DirectAction/foo";
String queryString = WOURLEncoder.encodeAsCGIFormValues(dict);
String handlerKey = application().directActionRequestHandlerKey();

String url = "" actionName, queryString);


Unfortunately, the problem is still there : if there is no session, instance number will not be part of the generated URL. It's the case for all the WOContext methods.

So I must handle this using an hack:

public String urlWithInstanceNumber() {
WORequest request = context().request();
int instanceNumber = request.applicationNumber();
String key = WOApplication.application().directActionRequestHandlerKey();

String url = "" ...);

if(!hasSession() && (instanceNumber > -1)) {
String search, replace;

search = String.format("\\.woa/%s", key);
replace = String.format(".woa/%d/%s", instanceNumber, key);

url = "" replace);
} // if

return url;
} // urlWithInstanceNumber

For a special function, I need whenever it's possible to generate DirectAction URL including instance number. Unfortunately, if there is no session, there is no instance number in URLs using WOHyperlink, WOActionURL, WOContext, etc. And of course, I dont want to create session!

 Is there a clean way to generate such URL with instance number?

--

Francis Labrie

Saint-Bruno-de-Montarville, Québec, Canada


 _______________________________________________
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

References: 
 >RE: Generate DirectAction URL with instance number when there is nosession (From: "Frank Caputo" <email@hidden>)

  • Prev by Date: Re: Stateless but get bindings of childs
  • Next by Date: Re: EOF Null Date FIXED
  • Previous by thread: RE: Generate DirectAction URL with instance number when there is nosession
  • Next by thread: EOF Null Date
  • Index(es):
    • Date
    • Thread