Direct Actions
Direct Actions
- Subject: Direct Actions
- From: David Griffith <email@hidden>
- Date: Mon, 21 Jun 2004 15:07:39 +0200
Hi all,
Quick question on direct actions:
public WOComponent referralAction() {
String referralID = (String)request().formValueForKey("referralID");
curSess.setReferralID(referralID);
return pageWithName("Main");
}
This is in my DirectAction.java file. I am using cookies also, to store
country and language settings. Everything works beautifully if you do not
use the Direct Action to access the site. If you use the direct action
above, it does capture the referral key, but when it returns the Main page,
I am trying to update cookies on that page. (This works perfectly if you
don9t use the direct action). However when using the direct action, I get a
java.nullPointerException at:
this.context().response().addCookie(langCookie);
Which is located in my Session.java file and is called from the Main
component - it is simply setting a cookie if there is none so that the
default value will be retained.
This is not crucial but there is obviously something I am overlooking here.
It seems to me that using the direct action somehow changes the context
that9s being used (or more obviously from the error, does not use a
context).
So, in simple terms, I want to be able to call the above direct action and
when I get to returning the Main component I want that to operate as it
would normally (in the same context as if it had been accessed normally
rather than via a direct action).
Can anyone see the problem here? It9s probably obvious..
Dave.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.