Callable Action method should return a Response object, to specify how the framework should handle the response to the client. Void return is also accepted, which will simply close the connection and no response is sent to the client.
This is a list of available classes implementing Response interface.
- ForwardResponse: request will be forwarded to the specified resource at the method completion
- RedirectResponse: user will be redirected to the specified resource at the method completion
- JSONResponse: a JSON stream, representing the passed object, will be sent to the client
- MessageResponse: a list of Message objects will be returned in JSON form.
- ActionResponse: the specified method of the specified Action will be invoked at the method completion. This is useful if you need to create and Action chain. Client will be served with the last Response in the chain.
- StreamingResponse: The given inputStream will be sent to the client using the specified content type and optionally file name
- StringResponse: The specified String will be sent to the client
- GenericResponse: two Response objects will be passed, one to answer to a "page" call, one to answer to a "ajax" call. Framework will choose automatically the correct one on the basis of the call type.
- void: void methods will be invoked and executed, but no response will be sent to the client at the method completion. If an error occurs, this is still transmitted to the client