Re: Assigning Sessions values from DirectAction.java
Re: Assigning Sessions values from DirectAction.java
- Subject: Re: Assigning Sessions values from DirectAction.java
- From: Kaj Hejer <email@hidden>
- Date: Thu, 27 Mar 2003 22:37:16 +0100
At 06:28 +0000 27-03-03, Riaz Lalehzari wrote:
Hello All,
How can I assign a value to one of my session variables from within
an action method in DirectAction.java? I've tried
session().setObjectForKey(variable, "val") and
session.setVal(variable).
Hi!
You can do this in atleast :) two ways:
1)
session().takeValueForKey(variable, "val");
See
<url:http://developer.apple.com/techpubs/webobjects/Reference/API/com/webobjects/foundation/NSKeyValueCoding.html#takeValueForKey(java.lang.Object, java.lang.String)>
for more info.
2)
make accessor methods for val in Session.java:
public mytype getVal()
and
public void setVal(mytype v)
and the use the following in DirectAction.java:
((Session) session()).setVal(variable)
-Kaj :)
_______________________________________________
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.