@@ -1059,23 +1059,23 @@ exception processing the HTTP request, an exception of the type `RestClientExcep
1059
1059
will be thrown; this behavior can be changed by plugging in another
1060
1060
`ResponseErrorHandler` implementation into the `RestTemplate`.
1061
1061
1062
- The `exchange` and `execute` methods are generalized versions of the more
1063
- specific methods listed above them and can support additional combinations and methods,
1064
- like HTTP PATCH. However, note that the underlying HTTP library must also support the
1065
- desired combination. The JDK `HttpURLConnection` does not support the `PATCH` method, but
1066
- Apache HttpComponents HttpClient version 4.2 or later does. They also enable
1067
- `RestTemplate` to read an HTTP response to a generic type (e.g. `List<Account>`), using a
1068
- `ParameterizedTypeReference`, a new class that enables capturing and passing generic
1069
- type info.
1062
+ The `exchange` and `execute` methods are generalized versions of the more specific
1063
+ methods listed above them and can support additional combinations and methods,
1064
+ e.g. HTTP PATCH. However, note that the underlying HTTP library must also support the
1065
+ desired combination. The JDK `HttpURLConnection` does not support the `PATCH` method
1066
+ but Apache HttpComponents HttpClient version 4.2 or later does. They also enable
1067
+ `RestTemplate` to read an HTTP response to a generic type (e.g. `List<Account>`),
1068
+ using a `ParameterizedTypeReference`, a new class that enables capturing and passing
1069
+ generic type info.
1070
1070
1071
1071
Objects passed to and returned from these methods are converted to and from HTTP
1072
- messages by `HttpMessageConverter` instances . Converters for the main mime types are
1073
- registered by default, but you can also write your own converter and register it via the
1074
- `messageConverters()` bean property. The default converter instances registered with the
1075
- template are `ByteArrayHttpMessageConverter`, `StringHttpMessageConverter`,
1076
- `FormHttpMessageConverter` and `SourceHttpMessageConverter`. You can override these
1077
- defaults using the `messageConverters()` bean property as would be required if using the
1078
- `MarshallingHttpMessageConverter` or `MappingJackson2HttpMessageConverter`.
1072
+ messages by `HttpMessageConverter` implementations . Converters for the main MIME types
1073
+ are registered by default, but you can also override the defaults and register custom
1074
+ converters via the `messageConverters()` bean property. The default converters are
1075
+ `ByteArrayHttpMessageConverter`, `StringHttpMessageConverter`,
1076
+ `ResourceHttpMessageConverter`, `SourceHttpMessageConverter` as well as
1077
+ `AllEncompassingFormHttpMessageConverter` and a few provider-specific converters:
1078
+ e.g. `MappingJackson2HttpMessageConverter` when Jackson is present on the classpath .
1079
1079
1080
1080
Each method takes URI template arguments in two forms, either as a `String`
1081
1081
variable-length argument or a `Map<String,String>`. For example,
@@ -5778,9 +5778,8 @@ exception hierarchy.
5778
5778
5779
5779
The `org.springframework.mail.javamail.JavaMailSender` interface adds specialized
5780
5780
__JavaMail__ features such as MIME message support to the `MailSender` interface (from
5781
- which it inherits). `JavaMailSender` also provides a callback interface for preparation
5782
- of JavaMail MIME messages, called
5783
- `org.springframework.mail.javamail.MimeMessagePreparator`
5781
+ which it inherits). `JavaMailSender` also provides a callback interface for preparing
5782
+ a 'MimeMessage', called `org.springframework.mail.javamail.MimeMessagePreparator`.
5784
5783
5785
5784
5786
5785
@@ -5903,23 +5902,17 @@ callback interface. Please note in this case that the `mailSender` property is o
5903
5902
}
5904
5903
5905
5904
public void placeOrder(final Order order) {
5906
-
5907
5905
// Do the business calculations...
5908
-
5909
5906
// Call the collaborators to persist the order...
5910
5907
5911
5908
MimeMessagePreparator preparator = new MimeMessagePreparator() {
5912
-
5913
5909
public void prepare(MimeMessage mimeMessage) throws Exception {
5914
-
5915
5910
mimeMessage.setRecipient(Message.RecipientType.TO,
5916
5911
new InternetAddress(order.getCustomer().getEmailAddress()));
5917
5912
mimeMessage.setFrom(new InternetAddress("[email protected] "));
5918
- mimeMessage.setText(
5919
- "Dear " + order.getCustomer().getFirstName() + " "
5920
- + order.getCustomer().getLastName()
5921
- + ", thank you for placing order. Your order number is "
5922
- + order.getOrderNumber());
5913
+ mimeMessage.setText("Dear " + order.getCustomer().getFirstName() + " " +
5914
+ order.getCustomer().getLastName() + ", thanks for your order. " +
5915
+ "Your order number is " + order.getOrderNumber() + ".");
5923
5916
}
5924
5917
};
5925
5918
@@ -6035,10 +6028,10 @@ along with an inline image.
6035
6028
6036
6029
[WARNING]
6037
6030
====
6038
- Inline resources are added to the mime message using the specified `Content-ID` (
6039
- `identifier1234` in the above example). The order in which you are adding the text and
6040
- the resource are __very__ important. Be sure to __first add the text__ and after that
6041
- the resources. If you are doing it the other way around, it won't work!
6031
+ Inline resources are added to the `MimeMessage` using the specified `Content-ID`
6032
+ ( `identifier1234` in the above example). The order in which you are adding the text
6033
+ and the resource are __very__ important. Be sure to __first add the text__ and after
6034
+ that the resources. If you are doing it the other way around, it won't work!
6042
6035
====
6043
6036
6044
6037
0 commit comments