Polishing

This commit is contained in:
Sam Brannen 2024-06-29 16:53:26 +02:00
parent 775a23b39d
commit ce53443cf0
2 changed files with 8 additions and 7 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -35,7 +35,7 @@ import org.springframework.util.Assert;
public abstract class ViewResolverSupport implements Ordered {
/**
* The default {@link MediaType content-type} for views.
* The default {@link MediaType content-type} for views: {@code "text/html;charset=UTF-8"}.
*/
public static final MediaType DEFAULT_CONTENT_TYPE = MediaType.parseMediaType("text/html;charset=UTF-8");
@ -54,7 +54,7 @@ public abstract class ViewResolverSupport implements Ordered {
/**
* Set the supported media types for this view.
* Default is "text/html;charset=UTF-8".
* <p>Default is {@code "text/html;charset=UTF-8"}.
*/
public void setSupportedMediaTypes(List<MediaType> supportedMediaTypes) {
Assert.notEmpty(supportedMediaTypes, "MediaType List must not be empty");
@ -72,7 +72,7 @@ public abstract class ViewResolverSupport implements Ordered {
/**
* Set the default charset for this view, used when the
* {@linkplain #setSupportedMediaTypes(List) content type} does not contain one.
* Default is {@linkplain StandardCharsets#UTF_8 UTF 8}.
* <p>Default is {@linkplain StandardCharsets#UTF_8 UTF-8}.
*/
public void setDefaultCharset(Charset defaultCharset) {
Assert.notNull(defaultCharset, "Default Charset must not be null");

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -196,9 +196,10 @@ public class UrlBasedViewResolver extends AbstractCachingViewResolver implements
}
/**
* Set the content type for all views.
* Set the content type for all views &mdash; for example,
* {@code "text/html;charset=UTF-8"}.
* <p>May be ignored by view classes if the view itself is assumed
* to set the content type, e.g. in case of JSPs.
* to set the content type &mdash; for example, in case of JSPs.
*/
public void setContentType(@Nullable String contentType) {
this.contentType = contentType;