@ -1014,23 +1014,23 @@ exception processing the HTTP request, an exception of the type `RestClientExcep
@@ -1014,23 +1014,23 @@ exception processing the HTTP request, an exception of the type `RestClientExcep
will be thrown; this behavior can be changed by plugging in another
`ResponseErrorHandler` implementation into the `RestTemplate`.
The `exchange` and `execute` methods are generalized versions of the more
specific methods listed above them and can support additional combinations and methods,
like HTTP PATCH. However, note that the underlying HTTP library must also support the
desired combination. The JDK `HttpURLConnection` does not support the `PATCH` method, but
Apache HttpComponents HttpClient version 4.2 or later does. They also enable
`RestTemplate` to read an HTTP response to a generic type (e.g. `List<Account>`), using a
`ParameterizedTypeReference`, a new class that enables capturing and passing generic
type info.
The `exchange` and `execute` methods are generalized versions of the more specific
methods listed above them and can support additional combinations and methods,
e.g. HTTP PATCH. However, note that the underlying HTTP library must also support the
desired combination. The JDK `HttpURLConnection` does not support the `PATCH` method
but Apache HttpComponents HttpClient version 4.2 or later does. They also enable
`RestTemplate` to read an HTTP response to a generic type (e.g. `List<Account>`),
using a `ParameterizedTypeReference`, a new class that enables capturing and passing
generic type info.
Objects passed to and returned from these methods are converted to and from HTTP
messages by `HttpMessageConverter` instances. Converters for the main mime types are
registered by default, but you can also write your own converter and register it via the
`messageConverters()` bean property. The default converter instances registered with the
template are `ByteArrayHttpMessageConverter`, `StringHttpMessageConverter`,
`FormHttpMessageConverter` and `SourceHttpMessageConverter`. You can override these
defaults using the `messageConverters()` bean property as would be required if using the
`MarshallingHttpMessageConverter` or `MappingJackson2HttpMessageConverter`.
messages by `HttpMessageConverter` implementations. Converters for the main MIME types
are registered by default, but you can also override the defaults and register custom
converters via the `messageConverters()` bean property. The default converters are
`ResourceHttpMessageConverter`, `SourceHttpMessageConverter` as well as
`AllEncompassingFormHttpMessageConverter` and a few provider-specific converters:
e.g. `MappingJackson2HttpMessageConverter` when Jackson is present on the classpath.
Each method takes URI template arguments in two forms, either as a `String`
variable-length argument or a `Map<String,String>`. For example,
@ -1213,7 +1213,7 @@ writing the body of HTTP requests and responses via `InputStream` and `OutputStr
@@ -1213,7 +1213,7 @@ writing the body of HTTP requests and responses via `InputStream` and `OutputStr
``HttpMessageConverter``'s are used on the client side, e.g. in the `RestTemplate`, and
also on the server side, e.g. in Spring MVC REST controllers.
Concrete implementations for the main media (mime) types are provided in the framework
Concrete implementations for the main media (MIME) types are provided in the framework
and are registered by default with the `RestTemplate` on the client-side and with
`RequestMethodHandlerAdapter` on the server-side (see
which it inherits). `JavaMailSender` also provides a callback interface for preparing
a 'MimeMessage', called `org.springframework.mail.javamail.MimeMessagePreparator`.
@ -5726,23 +5725,17 @@ callback interface. Please note in this case that the `mailSender` property is o
@@ -5726,23 +5725,17 @@ callback interface. Please note in this case that the `mailSender` property is o
}
public void placeOrder(final Order order) {
// Do the business calculations...
// Call the collaborators to persist the order...
MimeMessagePreparator preparator = new MimeMessagePreparator() {
public void prepare(MimeMessage mimeMessage) throws Exception {