Re: direct action URL without a session
Re: direct action URL without a session
- Subject: Re: direct action URL without a session
- From: René Bock <email@hidden>
- Date: Fri, 28 Oct 2016 13:54:03 +0000
- Thread-topic: direct action URL without a session
Hi,
you may consider storing the session (and instanceId) in cookies.
in my application I use something like
@Override
public WOSession createSessionForRequest(WORequest worequest) {
WOSession session = super.createSessionForRequest(worequest);
if(!isDevelopmentMode() && ( ERXProperties.booleanForKeyWithDefault("storesIDsInCookies", false))) {
session.setStoresIDsInCookies(true);
session.setStoresIDsInURLs(false);
}
return session;
}
> Am 28.10.2016 um 15:29 schrieb email@hidden:
>
> Hello there,
>
> the subject says it all — is there a decent way to construct a direct action URL from a code which has no session (and thus no context)? Note I need a full URL, not a relative one (it is to be used in diverse ways like “sent to client by an e-mail” etc.)
>
> At the moment, I use
>
> Application app=Application.application()
> String url=app.cgiAdaptorURL+'/'+app.name+'/'+app.directActionRequestHandlerKey+'/'+directActionName+'?'+directActionAttributeName+'='+directActionAttributeValue
>
> which sort of works, but is not too flexible (e.g., it stops working with direct access, where it lacks the port), it is very slightly incorrect (does not contain ".woa"; seems harmless, but still weird), and besides, is pretty ugly code (and would become far uglier with more attributes than one). Is there a better way?
>
> Thanks,
> OC
>
regards
René
_______________________________________________
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