Back to the client

 

Once your method is executed, what will be returned to the client is decided on what the method returns. 

Void methods, or a null return will interrupt the flow and nothing is returned to the client. 
If a Response is returned from the method, it will be used to serve the response to the client. 

Available responses are:

  • ForwardResponse(String page): The request will be forwarded to the specified page. This is the most common response.
  • RedirectResponse(String page): The request is redirected to the specified page. Keep in mind that redirect will generate new request/response objects.
  • StringResponse(String text[, String contentType]): The specified text is written on the ServletOutputStream, default contentType is text/html, or you can specify a different one in the second parameter.
  • StreamingResponse(InputStream input, String contentType[, String fileName][, boolean closeAfterSend]): The content of the specified InputStream is copied on the ServletOutputStream, using the specified contentType. if fileName is specified, content is appended to the response as an attachment with the specified fileName. The last parameter tells the Response object if the Inputstream should be closed after the write operation.
  • JSONResponse(Object bean[, int status]): The specified object is serialized in JSON format and written on the ServletOutputStream (see "Receiving your bean in javascript" for more details). If a status is specified, it will be used to set the response status.
  • GenericResponse(Response pageResponse, Response ajaxResponse): The framework will use one of the responses specified on the basys of the extension used to call the method, pageExtension or ajaxExtension.
  • ActionResponse(Class<? extends JavajaxAction> actionClass, String methodName): this response will forward the call to another action method, creating a call chain.

 

Support JavAjax

JavAjax is a free to use software, so you will never be asked for money to download and use it.
However, if you find it useful, you may consider to make a donation to let the work go on!


Support This Project

 

(You will be redirected to the donation page. Donation is done through Paypal)