• 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: Assigning Sessions values from DirectAction.java
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Assigning Sessions values from DirectAction.java (From: "Riaz Lalehzari" <email@hidden>)

  • Prev by Date: Re: [Newbie] Display new objects in a WODisplayGroup
  • Next by Date: Re: Assigning Sessions values from DirectAction.java
  • Previous by thread: Assigning Sessions values from DirectAction.java
  • Next by thread: Re: Assigning Sessions values from DirectAction.java
  • Index(es):
    • Date
    • Thread