Polishing

This commit is contained in:
Sam Brannen 2019-06-20 18:09:22 +03:00
parent da582dad7c
commit f56c54dfc8
2 changed files with 6 additions and 6 deletions

View File

@ -267,11 +267,11 @@ public class FormHttpMessageConverter implements HttpMessageConverter<MultiValue
public void write(MultiValueMap<String, ?> map, @Nullable MediaType contentType, HttpOutputMessage outputMessage)
throws IOException, HttpMessageNotWritableException {
if (!isMultipart(map, contentType)) {
writeForm((MultiValueMap<String, Object>) map, contentType, outputMessage);
if (isMultipart(map, contentType)) {
writeMultipart((MultiValueMap<String, Object>) map, outputMessage);
}
else {
writeMultipart((MultiValueMap<String, Object>) map, outputMessage);
writeForm((MultiValueMap<String, Object>) map, contentType, outputMessage);
}
}

View File

@ -35,7 +35,7 @@ import org.springframework.stereotype.Component;
* <p>Classes with {@code @ControllerAdvice} can be declared explicitly as Spring
* beans or auto-detected via classpath scanning. All such beans are sorted via
* {@link org.springframework.core.annotation.AnnotationAwareOrderComparator
* AnnotationAwareOrderComparator}, i.e. based on
* AnnotationAwareOrderComparator}, based on
* {@link org.springframework.core.annotation.Order @Order} and
* {@link org.springframework.core.Ordered Ordered}, and applied in that order
* at runtime. For handling exceptions, an {@code @ExceptionHandler} will be
@ -51,12 +51,12 @@ import org.springframework.stereotype.Component;
* root exception mappings on a prioritized advice bean with a corresponding order.
*
* <p>By default, the methods in an {@code @ControllerAdvice} apply globally to
* all controllers. Use selectors {@link #annotations},
* all controllers. Use selectors such as {@link #annotations},
* {@link #basePackageClasses}, and {@link #basePackages} (or its alias
* {@link #value}) to define a more narrow subset of targeted controllers.
* If multiple selectors are declared, boolean {@code OR} logic is applied, meaning
* selected controllers should match at least one selector. Note that selector checks
* are performed at runtime and so adding many selectors may negatively impact
* are performed at runtime, so adding many selectors may negatively impact
* performance and add complexity.
*
* @author Rossen Stoyanchev