Inherits from: NSObject
Package: com.apple.yellow.webobjects
WODirectAction is an abstract class that defines the interface for direct action classes. You subclass WODirectAction to provide an object that is a repository for action methods.
WODirectAction provides the simplest interface for addig logic and custom code to your WebObjects application. WODirectAction objects are instantiated when a URL requested by a client browser is sent to your WebObjects application. The WODirectActionRequestHandler determines the proper class and action to be invoked and then passes control to your WODirectAction subclass.
In contrast to a WOComponent-based action, a direct action is well-defined by the URL that invokes it. For example, the following URL will invoke the method findEmployeeAction on the subclass of WODirectAtion called Common:
http://localhost/cgi-bin/WebObjects/Myapp.woa/wa/Common/findEmployee
A subclass of WODirectAction is a repository for action methods. New WebObjects applications contain a default implementation of the WODirectAction subclass called DirectAction. The DirectAction class is used when no class is specified in the URL.
In summary, here are some URLs and the actions they invoke:
This URL... | Invokes this method... |
../MyApp.woa/wa/ | defaultAction on class DirectAction |
../MyApp.woa/wa/ find | findAction on classDirectAction , if it exists defaultAction on class find , otherwise |
../MyApp.woa/wa/Common/find | findAction on class Common |
WODirectActionRequestHandler invokes methods only on subclasses on WODirectAction. If the specified class or action doesn't exist, WODirectActionRequestHandler throws an exception.
- Constructors
- WODirectAction
- Obtaining attributes
- request
- Obtaining a session
- existingSession
- session
- Obtaining a page
- pageWithName
- Performing an action
- performActionNamed
- Value assignment
- takeFormValueArraysForKeyArray
- takeFormValuesForKeyArray
- Debugging
- debugString
- logString
public WODirectAction(WORequest aWORequest)
public static void debugString(String aString)
public static void logString(String aString)
int i = 500; float f = 2.045; WOComponent.logString("Amount = " + i + ", Rate = " + f ", Total = " + i*f);
public WOSession existingSession()
See Also: session
public WOComponent pageWithName(String aComponentName)
public WOActionResults performActionNamed(String anActionName)
public WORequest request()
public WOSession session()
See Also: existingSession
public void takeFormValueArraysForKeyArray(NSArray aKeyArray)
This method uses an NSArray for each form value. This is useful when a user can select multiple items for a form value, such as a WOBrowser. If a form value contains only one item, this method uses an NSArray with one object. To use single objects as form values, use takeFormValuesForKeyArray.
See Also: takeFormValueArraysForKeys:
public void takeFormValuesForKeyArray(NSArray aKeyArray)
This method uses an a single object for each form value. If a form value contains more than one item, such as a WOBrowser, this method uses the first item in the array. To use arrays of objects as form values, use takeFormValueArraysForKeyArray.
See Also: takeFormValuesForKeys: