spring-framework / org.springframework.web.servlet.mvc.method.annotation / ResponseBodyEmitter / send

send

open fun send(object: Any): Unit

Write the given object to the response.

If any exception occurs a dispatch is made back to the app server where Spring MVC will pass the exception through its exception handling mechanism.

Parameters

object - the object to write

Exceptions

IOException - raised when an I/O error occurs

java.lang.IllegalStateException - wraps any other errors

open fun send(object: Any, @Nullable mediaType: MediaType): Unit

Write the given object to the response also using a MediaType hint.

If any exception occurs a dispatch is made back to the app server where Spring MVC will pass the exception through its exception handling mechanism.

Parameters

object - the object to write

mediaType - a MediaType hint for selecting an HttpMessageConverter

Exceptions

IOException - raised when an I/O error occurs

java.lang.IllegalStateException - wraps any other errors