Table of Contents Previous Section
Component Action Request-Handling Methods
By default, your application uses the component action request handling loop. ( "Setting the Default Request Handler" shows you how to make the direct action request handling loop the default for your application.) Component action request handling is performed in three phases, which correspond to three methods you can override:
- Taking input values from the request (takeValuesFromRequest:inContext: or takeValuesFromRequest)
- Invoking the action (invokeActionForRequest:inContext: or invokeAction)
- Generating a response (appendToResponse:inContext: or appendToResponse)
The request-handling methods handle three types of objects:
- A request object (WORequest) is passed as an argument in the first two phases. This object represents a user request. You can use it to retrieve information about the request, such as the method line, request headers, URL, and form values.
- A context object (WOContext) is passed as an argument in all three phases. This object represents the current context of the request. It contains references to information specific to the request, such as the current component, current session, and current request.
- A response object (WOResponse) is passed in the final phase. This object encapsulates information contained in the generated HTTP response, such as the status, response headers, and response content.
As you implement request-handling methods, you must invoke the superclass's implementation of the same methods. But consider where you invoke it because it can affect the request, response, and context information available at any given point. In short, you want to perform certain tasks before super is invoked and other tasks after super is invoked.
Table of Contents Next Section