Replace 'e.g.' with 'for example' in documentation and comments

Closes gh-33515
This commit is contained in:
Yanming Zhou
2024-09-26 14:03:46 +02:00
committed by Sam Brannen
parent e55fe9077f
commit 8941e2876e
722 changed files with 1290 additions and 1290 deletions

View File

@@ -28,7 +28,7 @@ import org.springframework.web.method.HandlerMethod;
* <p>When a handler starts an asynchronous request, the {@link DispatcherServlet}
* exits without invoking {@code postHandle} and {@code afterCompletion} as it
* normally does for a synchronous request, since the result of request handling
* (e.g. ModelAndView) is likely not yet ready and will be produced concurrently
* (for example, ModelAndView) is likely not yet ready and will be produced concurrently
* from another thread. In such scenarios, {@link #afterConcurrentHandlingStarted}
* is invoked instead, allowing implementations to perform tasks such as cleaning
* up thread-bound attributes before releasing the thread to the Servlet container.

View File

@@ -66,7 +66,7 @@ import org.springframework.web.util.ServletRequestPathUtils;
import org.springframework.web.util.WebUtils;
/**
* Central dispatcher for HTTP request handlers/controllers, e.g. for web UI controllers
* Central dispatcher for HTTP request handlers/controllers, for example, for web UI controllers
* or HTTP-based remote service exporters. Dispatches to registered handlers for processing
* a web request, providing convenient mapping and exception handling facilities.
*
@@ -266,7 +266,7 @@ public class DispatcherServlet extends FrameworkServlet {
/**
* Name of request attribute that exposes an Exception resolved with a
* {@link HandlerExceptionResolver} but where no view was rendered
* (e.g. setting the status code).
* (for example, setting the status code).
*/
public static final String EXCEPTION_ATTRIBUTE = DispatcherServlet.class.getName() + ".EXCEPTION";
@@ -1215,7 +1215,7 @@ public class DispatcherServlet extends FrameworkServlet {
if (this.multipartResolver != null && this.multipartResolver.isMultipart(request)) {
if (WebUtils.getNativeRequest(request, MultipartHttpServletRequest.class) != null) {
if (DispatcherType.REQUEST.equals(request.getDispatcherType())) {
logger.trace("Request already resolved to MultipartHttpServletRequest, e.g. by MultipartFilter");
logger.trace("Request already resolved to MultipartHttpServletRequest, for example, by MultipartFilter");
}
}
else if (hasMultipartException(request)) {

View File

@@ -27,7 +27,7 @@ import org.springframework.util.StringUtils;
/**
* A FlashMap provides a way for one request to store attributes intended for
* use in another. This is most commonly needed when redirecting from one URL
* to another -- e.g. the Post/Redirect/Get pattern. A FlashMap is saved before
* to another -- for example, the Post/Redirect/Get pattern. A FlashMap is saved before
* the redirect (typically in the session) and is made available after the
* redirect and removed immediately.
*
@@ -59,8 +59,8 @@ public final class FlashMap extends HashMap<String, Object> implements Comparabl
/**
* Provide a URL path to help identify the target request for this FlashMap.
* <p>The path may be absolute (e.g. "/application/resource") or relative to the
* current request (e.g. "../resource").
* <p>The path may be absolute (for example, "/application/resource") or relative to the
* current request (for example, "../resource").
*/
public void setTargetRequestPath(@Nullable String path) {
this.targetRequestPath = path;

View File

@@ -101,7 +101,7 @@ import org.springframework.web.util.WebUtils;
* specifies one or more {@link org.springframework.context.ApplicationContextInitializer
* ApplicationContextInitializer} classes. The managed web application context will be
* delegated to these initializers, allowing for additional programmatic configuration,
* e.g. adding property sources or activating profiles against the {@linkplain
* for example, adding property sources or activating profiles against the {@linkplain
* org.springframework.context.ConfigurableApplicationContext#getEnvironment() context's
* environment}. See also {@link org.springframework.web.context.ContextLoader} which
* supports a "contextInitializerClasses" context-param with identical semantics for
@@ -118,7 +118,7 @@ import org.springframework.web.util.WebUtils;
* default ApplicationContext implementation. This can be leveraged to
* deliberately override certain bean definitions via an extra XML file.
*
* <p>The default namespace is "'servlet-name'-servlet", e.g. "test-servlet" for a
* <p>The default namespace is "'servlet-name'-servlet", for example, "test-servlet" for a
* servlet-name "test" (leading to a "/WEB-INF/test-servlet.xml" default location
* with XmlWebApplicationContext). The namespace can also be set explicitly via
* the "namespace" servlet init-param.
@@ -362,7 +362,7 @@ public abstract class FrameworkServlet extends HttpServletBean implements Applic
/**
* Return the namespace for this servlet, falling back to default scheme if
* no custom namespace was set: e.g. "test-servlet" for a servlet named "test".
* no custom namespace was set: for example, "test-servlet" for a servlet named "test".
*/
public String getNamespace() {
return (this.namespace != null ? this.namespace : getServletName() + DEFAULT_NAMESPACE_SUFFIX);
@@ -439,7 +439,7 @@ public abstract class FrameworkServlet extends HttpServletBean implements Applic
* (that is, ending after their initial task, without reuse of the thread).
* <p><b>WARNING:</b> Do not use inheritance for child threads if you are
* accessing a thread pool which is configured to potentially add new threads
* on demand (e.g. a JDK {@link java.util.concurrent.ThreadPoolExecutor}),
* on demand (for example, a JDK {@link java.util.concurrent.ThreadPoolExecutor}),
* since this will expose the inherited context to such a pooled thread.
*/
public void setThreadContextInheritable(boolean threadContextInheritable) {

View File

@@ -61,7 +61,7 @@ import org.springframework.web.method.HandlerMethod;
* common handler code and authorization checks. On the other hand, a Filter
* is well-suited for request content and view content handling, like multipart
* forms and GZIP compression. This typically shows when one needs to map the
* filter to certain content types (e.g. images), or to all requests.
* filter to certain content types (for example, images), or to all requests.
*
* <p><strong>Note:</strong> Interceptors are not ideally suited as a security
* layer due to the potential for a mismatch with annotated controller path matching.

View File

@@ -51,7 +51,7 @@ public class AsyncSupportConfigurer {
* <ol>
* <li>Handle {@link Callable} controller method return values.
* <li>Perform blocking writes when streaming to the response
* through a reactive (e.g. Reactor, RxJava) controller method return value.
* through a reactive (for example, Reactor, RxJava) controller method return value.
* </ol>
* <p>If your application has controllers with such return types, please
* configure an {@link AsyncTaskExecutor} as the one used by default is not

View File

@@ -76,7 +76,7 @@ public class CorsRegistration {
}
/**
* Set the HTTP methods to allow, e.g. {@code "GET"}, {@code "POST"}, etc.
* Set the HTTP methods to allow, for example, {@code "GET"}, {@code "POST"}, etc.
* The special value {@code "*"} allows all methods. By default,
* "simple" methods {@code GET}, {@code HEAD}, and {@code POST}
* are allowed.

View File

@@ -26,7 +26,7 @@ import org.springframework.context.annotation.Import;
/**
* Adding this annotation to an {@code @Configuration} class imports the Spring MVC
* configuration from {@link WebMvcConfigurationSupport}, e.g.:
* configuration from {@link WebMvcConfigurationSupport}, for example:
*
* <pre class="code">
* &#064;Configuration
@@ -37,7 +37,7 @@ import org.springframework.context.annotation.Import;
* </pre>
*
* <p>To customize the imported configuration, implement the interface
* {@link WebMvcConfigurer} and override individual methods, e.g.:
* {@link WebMvcConfigurer} and override individual methods, for example:
*
* <pre class="code">
* &#064;Configuration
@@ -67,7 +67,7 @@ import org.springframework.context.annotation.Import;
* <p>If {@link WebMvcConfigurer} does not expose some more advanced setting that
* needs to be configured, consider removing the {@code @EnableWebMvc}
* annotation and extending directly from {@link WebMvcConfigurationSupport}
* or {@link DelegatingWebMvcConfiguration}, e.g.:
* or {@link DelegatingWebMvcConfiguration}, for example:
*
* <pre class="code">
* &#064;Configuration

View File

@@ -84,9 +84,9 @@ public class ResourceHandlerRegistration {
* {@code /META-INF/public-web-resources/} directory, with resources in the
* web application root taking precedence.
* <p>For {@link org.springframework.core.io.UrlResource URL-based resources}
* (e.g. files, HTTP URLs, etc) this method supports a special prefix to
* (for example, files, HTTP URLs, etc) this method supports a special prefix to
* indicate the charset associated with the URL so that relative paths
* appended to it can be encoded correctly, e.g.
* appended to it can be encoded correctly, for example,
* {@code [charset=Windows-31J]https://example.org/path}.
* @return the same {@link ResourceHandlerRegistration} instance, for
* chained method invocation

View File

@@ -48,11 +48,11 @@ import org.springframework.web.util.pattern.PathPattern;
*
* <p>To create a resource handler, use {@link #addResourceHandler(String...)}
* providing the URL path patterns for which the handler should be invoked to
* serve static resources (e.g. {@code "/resources/**"}).
* serve static resources (for example, {@code "/resources/**"}).
*
* <p>Then use additional methods on the returned
* {@link ResourceHandlerRegistration} to add one or more locations from which
* to serve static content from (e.g. {{@code "/"},
* to serve static content from (for example, {{@code "/"},
* {@code "classpath:/META-INF/public-web-resources/"}}) or to specify a cache
* period for served resources.
*

View File

@@ -89,7 +89,7 @@ public class ViewResolverRegistry {
/**
* Enable use of a {@link ContentNegotiatingViewResolver} to front all other
* configured view resolvers and select among all selected Views based on
* media types requested by the client (e.g. in the Accept header).
* media types requested by the client (for example, in the Accept header).
* <p>If invoked multiple times the provided default views will be added to
* any other default views that may have been configured already.
* @see ContentNegotiatingViewResolver#setDefaultViews
@@ -101,7 +101,7 @@ public class ViewResolverRegistry {
/**
* Enable use of a {@link ContentNegotiatingViewResolver} to front all other
* configured view resolvers and select among all selected Views based on
* media types requested by the client (e.g. in the Accept header).
* media types requested by the client (for example, in the Accept header).
* <p>If invoked multiple times the provided default views will be added to
* any other default views that may have been configured already.
* @see ContentNegotiatingViewResolver#setDefaultViews

View File

@@ -268,7 +268,7 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
/**
* Set the Spring {@link ApplicationContext}, e.g. for resource loading.
* Set the Spring {@link ApplicationContext}, for example, for resource loading.
*/
@Override
public void setApplicationContext(@Nullable ApplicationContext applicationContext) {
@@ -285,7 +285,7 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
}
/**
* Set the {@link jakarta.servlet.ServletContext}, e.g. for resource handling,
* Set the {@link jakarta.servlet.ServletContext}, for example, for resource handling,
* looking up file extensions, etc.
*/
@Override
@@ -807,7 +807,7 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
* Add custom {@link HandlerMethodArgumentResolver HandlerMethodArgumentResolvers}
* to use in addition to the ones registered by default.
* <p>Custom argument resolvers are invoked before built-in resolvers except for
* those that rely on the presence of annotations (e.g. {@code @RequestParameter},
* those that rely on the presence of annotations (for example, {@code @RequestParameter},
* {@code @PathVariable}, etc). The latter can be customized by configuring the
* {@link RequestMappingHandlerAdapter} directly.
* @param argumentResolvers the list of custom converters (initially an empty list)
@@ -833,7 +833,7 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
* Add custom {@link HandlerMethodReturnValueHandler HandlerMethodReturnValueHandlers}
* in addition to the ones registered by default.
* <p>Custom return value handlers are invoked before built-in ones except for
* those that rely on the presence of annotations (e.g. {@code @ResponseBody},
* those that rely on the presence of annotations (for example, {@code @ResponseBody},
* {@code @ModelAttribute}, etc). The latter can be customized by configuring the
* {@link RequestMappingHandlerAdapter} directly.
* @param returnValueHandlers the list of custom handlers (initially an empty list)

View File

@@ -124,7 +124,7 @@ public interface WebMvcConfigurer {
/**
* Configure simple automated controllers pre-configured with the response
* status code and/or a view to render the response body. This is useful in
* cases where there is no need for custom controller logic -- e.g. render a
* cases where there is no need for custom controller logic -- for example, render a
* home page, perform simple site URL redirects, return a 404 status with
* HTML content, a 204 with no content, and more.
* @see ViewControllerRegistry

View File

@@ -113,7 +113,7 @@ class DefaultServerRequest implements ServerRequest {
this.params = CollectionUtils.toMultiValueMap(new ServletParametersMap(servletRequest));
this.attributes = new ServletAttributesMap(servletRequest);
// DispatcherServlet parses the path but for other scenarios (e.g. tests) we might need to
// DispatcherServlet parses the path but for other scenarios (for example, tests) we might need to
this.requestPath = (ServletRequestPathUtils.hasParsedRequestPath(servletRequest) ?
ServletRequestPathUtils.getParsedRequestPath(servletRequest) :

View File

@@ -197,7 +197,7 @@ public interface EntityResponse<T> extends ServerResponse {
Builder<T> cacheControl(CacheControl cacheControl);
/**
* Configure one or more request header names (e.g. "Accept-Language") to
* Configure one or more request header names (for example, "Accept-Language") to
* add to the "Vary" response header to inform clients that the response is
* subject to content negotiation and variances based on the value of the
* given request headers. The configured request header names are added only

View File

@@ -66,7 +66,7 @@ public interface ServerRequest {
/**
* Get the HTTP method.
* @return the HTTP method as an HttpMethod enum value, or {@code null}
* if not resolvable (e.g. in case of a non-standard HTTP method)
* if not resolvable (for example, in case of a non-standard HTTP method)
*/
HttpMethod method();
@@ -165,7 +165,7 @@ public interface ServerRequest {
/**
* Bind to this request and return an instance of the given type.
* @param bindType the type of class to bind this request to
* @param dataBinderCustomizer used to customize the data binder, e.g. set
* @param dataBinderCustomizer used to customize the data binder, for example, set
* (dis)allowed fields
* @param <T> the type to bind to
* @return a constructed and bound instance of {@code bindType}

View File

@@ -437,7 +437,7 @@ public interface ServerResponse {
B cacheControl(CacheControl cacheControl);
/**
* Configure one or more request header names (e.g. "Accept-Language") to
* Configure one or more request header names (for example, "Accept-Language") to
* add to the "Vary" response header to inform clients that the response is
* subject to content negotiation and variances based on the value of the
* given request headers. The configured request header names are added only

View File

@@ -55,7 +55,7 @@ public abstract class AbstractHandlerMethodExceptionResolver extends AbstractHan
}
/**
* Whether this resolver has global exception handlers, e.g. not declared in
* Whether this resolver has global exception handlers, for example, not declared in
* the same class as the {@code HandlerMethod} that raised the exception and
* therefore can apply to any handler.
* @since 5.3

View File

@@ -126,7 +126,7 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap
* Configure the naming strategy to use for assigning a default name to every
* mapped handler method.
* <p>The default naming strategy is based on the capital letters of the
* class name followed by "#" and then the method name, e.g. "TC#getFoo"
* class name followed by "#" and then the method name, for example, "TC#getFoo"
* for a class named TestController with method getFoo.
*/
public void setHandlerMethodMappingNamingStrategy(HandlerMethodMappingNamingStrategy<T> namingStrategy) {

View File

@@ -31,7 +31,7 @@ import org.springframework.util.CollectionUtils;
* instances and mapping to bean names; the latter is required for non-singleton handlers.
*
* <p>The "urlMap" property is suitable for populating the handler map with
* bean references, e.g. via the map element in XML bean definitions.
* bean references, for example, via the map element in XML bean definitions.
*
* <p>Mappings to bean names can be set via the "mappings" property, in a form
* accepted by the {@code java.util.Properties} class, as follows:

View File

@@ -47,7 +47,7 @@ import org.springframework.web.util.WebUtils;
* alternatively, you may specify a default time zone.
*
* <p>Custom controllers can override the user's locale and time zone by calling
* {@code #setLocale(Context)} on the resolver, e.g. responding to a locale change
* {@code #setLocale(Context)} on the resolver, for example, responding to a locale change
* request. As a more convenient alternative, consider using
* {@link org.springframework.web.servlet.support.RequestContext#changeLocale}.
*
@@ -233,7 +233,7 @@ public class CookieLocaleResolver extends AbstractLocaleContextResolver {
}
/**
* Specify whether to reject cookies with invalid content (e.g. invalid format).
* Specify whether to reject cookies with invalid content (for example, invalid format).
* <p>The default is {@code true}. Turn this off for lenient handling of parse
* failures, falling back to the default locale and time zone in such a case.
* @since 5.1.7
@@ -247,7 +247,7 @@ public class CookieLocaleResolver extends AbstractLocaleContextResolver {
}
/**
* Return whether to reject cookies with invalid content (e.g. invalid format).
* Return whether to reject cookies with invalid content (for example, invalid format).
* @since 5.1.7
*/
public boolean isRejectInvalidCookies() {
@@ -342,7 +342,7 @@ public class CookieLocaleResolver extends AbstractLocaleContextResolver {
this.cookie.getName() + "': [" + value + "] due to: " + ex.getMessage());
}
else {
// Lenient handling (e.g. error dispatch): ignore locale/timezone parse exceptions
// Lenient handling (for example, error dispatch): ignore locale/timezone parse exceptions
if (logger.isDebugEnabled()) {
logger.debug("Ignoring invalid locale cookie '" + this.cookie.getName() +
"': [" + value + "] due to: " + ex.getMessage());

View File

@@ -41,7 +41,7 @@ import org.springframework.web.util.WebUtils;
* attribute as well; alternatively, you may specify a default time zone.
*
* <p>Custom controllers can override the user's locale and time zone by calling
* {@code #setLocale(Context)} on the resolver, e.g. responding to a locale change
* {@code #setLocale(Context)} on the resolver, for example, responding to a locale change
* request. As a more convenient alternative, consider using
* {@link org.springframework.web.servlet.support.RequestContext#changeLocale}.
*

View File

@@ -59,7 +59,7 @@ import org.springframework.web.util.WebUtils;
*
* <b>Example:</b> myDispatcher-servlet.xml, in turn forwarding "/myservlet" to your
* servlet (identified by servlet name). All such requests will go through the
* configured HandlerInterceptor chain (e.g. an OpenSessionInViewInterceptor).
* configured HandlerInterceptor chain (for example, an OpenSessionInViewInterceptor).
* From the servlet point of view, everything will work as usual.
*
* <pre class="code">

View File

@@ -48,7 +48,7 @@ import org.springframework.web.servlet.ModelAndView;
*
* <p><b>Example:</b> a DispatcherServlet XML context, forwarding "*.do" to the Struts
* ActionServlet wrapped by a ServletWrappingController. All such requests will go
* through the configured HandlerInterceptor chain (e.g. an OpenSessionInViewInterceptor).
* through the configured HandlerInterceptor chain (for example, an OpenSessionInViewInterceptor).
* From the Struts point of view, everything will work as usual.
*
* <pre class="code">

View File

@@ -101,7 +101,7 @@ public class ResponseStatusExceptionResolver extends AbstractHandlerExceptionRes
* @param request current HTTP request
* @param response current HTTP response
* @param handler the executed handler, or {@code null} if none chosen at the
* time of the exception, e.g. if multipart resolution failed
* time of the exception, for example, if multipart resolution failed
* @param ex the exception
* @return an empty ModelAndView, i.e. exception resolved
*/
@@ -123,7 +123,7 @@ public class ResponseStatusExceptionResolver extends AbstractHandlerExceptionRes
* @param request current HTTP request
* @param response current HTTP response
* @param handler the executed handler, or {@code null} if none chosen at the
* time of the exception, e.g. if multipart resolution failed
* time of the exception, for example, if multipart resolution failed
* @return an empty ModelAndView, i.e. exception resolved
* @since 5.0
*/

View File

@@ -20,7 +20,7 @@ import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* A contract for media type expressions (e.g. "text/plain", "!text/plain") as
* A contract for media type expressions (for example, "text/plain", "!text/plain") as
* defined in the {@code @RequestMapping} annotation for "consumes" and
* "produces" conditions.
*

View File

@@ -287,7 +287,7 @@ public class PatternsRequestCondition extends AbstractRequestCondition<PatternsR
* Find the patterns matching the given lookup path. Invoking this method should
* yield results equivalent to those of calling {@link #getMatchingCondition}.
* This method is provided as an alternative to be used if no request is available
* (e.g. introspection, tooling, etc).
* (for example, introspection, tooling, etc).
* @param lookupPath the lookup path to match to existing patterns
* @return a collection of matching patterns sorted with the closest match at the top
*/

View File

@@ -51,7 +51,7 @@ public interface RequestCondition<T> {
* multiple URL patterns may return a new instance only with those patterns
* that match the request.
* <p>For CORS pre-flight requests, conditions should match to the would-be,
* actual request (e.g. URL pattern, query parameters, and the HTTP method
* actual request (for example, URL pattern, query parameters, and the HTTP method
* from the "Access-Control-Request-Method" header). If a condition cannot
* be matched to a pre-flight request it should return an instance with
* empty content thus not causing a failure to match.

View File

@@ -25,7 +25,7 @@ import org.springframework.lang.Nullable;
/**
* A holder for a {@link RequestCondition} useful when the type of the request
* condition is not known ahead of time, e.g. custom condition. Since this
* condition is not known ahead of time, for example, custom condition. Since this
* class is also an implementation of {@code RequestCondition}, effectively it
* decorates the held request condition and allows it to be combined and compared
* with other request conditions in a type and null safe way.

View File

@@ -139,7 +139,7 @@ public abstract class AbstractMessageConverterMethodArgumentResolver implements
* @param inputMessage the HTTP input message representing the current request
* @param parameter the method parameter descriptor
* @param targetType the target type, not necessarily the same as the method
* parameter type, e.g. for {@code HttpEntity<String>}.
* parameter type, for example, for {@code HttpEntity<String>}.
* @return the created method argument value
* @throws IOException if the reading from the request fails
* @throws HttpMediaTypeNotSupportedException if no suitable message converter is found
@@ -347,7 +347,7 @@ public abstract class AbstractMessageConverterMethodArgumentResolver implements
/**
* Allow for closing the body stream if necessary,
* e.g. for part streams in a multipart request.
* for example, for part streams in a multipart request.
*/
void closeStreamIfNecessary(InputStream body) {
// No-op by default: A standard HttpInputMessage exposes the HTTP request stream

View File

@@ -373,7 +373,7 @@ public abstract class AbstractMessageConverterMethodProcessor extends AbstractMe
* Return the type of the value to be written to the response. Typically this is
* a simple check via getClass on the value but if the value is null, then the
* return type needs to be examined possibly including generic type determination
* (e.g. {@code ResponseEntity<T>}).
* (for example, {@code ResponseEntity<T>}).
*/
protected Class<?> getReturnValueType(@Nullable Object value, MethodParameter returnType) {
return (value != null ? value.getClass() : returnType.getParameterType());

View File

@@ -475,7 +475,7 @@ public class ExceptionHandlerExceptionResolver extends AbstractHandlerMethodExce
return new ModelAndView();
}
// Any other than the original exception (or a cause) is unintended here,
// probably an accident (e.g. failed assertion or the like).
// probably an accident (for example, failed assertion or the like).
if (!exceptions.contains(invocationEx) && logger.isWarnEnabled()) {
logger.warn("Failure in @ExceptionHandler " + exceptionHandlerMethod, invocationEx);
}

View File

@@ -43,7 +43,7 @@ public interface RequestBodyAdvice {
* Invoked first to determine if this interceptor applies.
* @param methodParameter the method parameter
* @param targetType the target type, not necessarily the same as the method
* parameter type, e.g. for {@code HttpEntity<String>}.
* parameter type, for example, for {@code HttpEntity<String>}.
* @param converterType the selected converter type
* @return whether this interceptor should be invoked or not
*/
@@ -55,7 +55,7 @@ public interface RequestBodyAdvice {
* @param inputMessage the request
* @param parameter the target method parameter
* @param targetType the target type, not necessarily the same as the method
* parameter type, e.g. for {@code HttpEntity<String>}.
* parameter type, for example, for {@code HttpEntity<String>}.
* @param converterType the converter used to deserialize the body
* @return the input request or a new instance (never {@code null})
*/
@@ -68,7 +68,7 @@ public interface RequestBodyAdvice {
* @param inputMessage the request
* @param parameter the target method parameter
* @param targetType the target type, not necessarily the same as the method
* parameter type, e.g. for {@code HttpEntity<String>}.
* parameter type, for example, for {@code HttpEntity<String>}.
* @param converterType the converter used to deserialize the body
* @return the same body or a new instance
*/
@@ -81,7 +81,7 @@ public interface RequestBodyAdvice {
* @param inputMessage the request
* @param parameter the method parameter
* @param targetType the target type, not necessarily the same as the method
* parameter type, e.g. for {@code HttpEntity<String>}.
* parameter type, for example, for {@code HttpEntity<String>}.
* @param converterType the selected converter type
* @return the value to use, or {@code null} which may then raise an
* {@code HttpMessageNotReadableException} if the argument is required

View File

@@ -559,7 +559,7 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter
/**
* Set the ParameterNameDiscoverer to use for resolving method parameter names if needed
* (e.g. for default attribute names).
* (for example, for default attribute names).
* <p>Default is a {@link org.springframework.core.DefaultParameterNameDiscoverer}.
*/
public void setParameterNameDiscoverer(ParameterNameDiscoverer parameterNameDiscoverer) {

View File

@@ -666,7 +666,7 @@ public abstract class ResponseEntityExceptionHandler implements MessageSourceAwa
/**
* Create the {@link ResponseEntity} to use from the given body, headers,
* and statusCode. Subclasses can override this method to inspect and possibly
* modify the body, headers, or statusCode, e.g. to re-create an instance of
* modify the body, headers, or statusCode, for example, to re-create an instance of
* {@link ProblemDetail} as an extension of {@link ProblemDetail}.
* @param body the body to use for the response
* @param headers the headers to use for the response

View File

@@ -80,7 +80,7 @@ public class ServletInvocableHandlerMethod extends InvocableHandlerMethod {
/**
* Variant of {@link #ServletInvocableHandlerMethod(Object, Method)} that
* also accepts a {@link MessageSource}, e.g. to resolve
* also accepts a {@link MessageSource}, for example, to resolve
* {@code @ResponseStatus} messages with.
* @since 5.3.10
*/
@@ -198,7 +198,7 @@ public class ServletInvocableHandlerMethod extends InvocableHandlerMethod {
* Create a nested ServletInvocableHandlerMethod subclass that returns the
* given value (or raises an Exception if the value is one) rather than
* actually invoking the controller method. This is useful when processing
* async return values (e.g. Callable, DeferredResult, ListenableFuture).
* async return values (for example, Callable, DeferredResult, ListenableFuture).
*/
ServletInvocableHandlerMethod wrapConcurrentResult(@Nullable Object result) {
return new ConcurrentResultHandlerMethod(result, new ConcurrentResultMethodParameter(result));
@@ -242,7 +242,7 @@ public class ServletInvocableHandlerMethod extends InvocableHandlerMethod {
/**
* Bridge to actual return value or generic type within the declared
* async return type, e.g. Foo instead of {@code DeferredResult<Foo>}.
* async return type, for example, Foo instead of {@code DeferredResult<Foo>}.
*/
@Override
public MethodParameter getReturnValueType(@Nullable Object returnValue) {
@@ -271,7 +271,7 @@ public class ServletInvocableHandlerMethod extends InvocableHandlerMethod {
/**
* MethodParameter subclass based on the actual return value type or if
* that's null falling back on the generic type within the declared async
* return type, e.g. Foo instead of {@code DeferredResult<Foo>}.
* return type, for example, Foo instead of {@code DeferredResult<Foo>}.
*/
private class ConcurrentResultMethodParameter extends AnnotatedMethodParameter {

View File

@@ -117,7 +117,7 @@ public class ServletModelAttributeMethodProcessor extends ModelAttributeMethodPr
}
/**
* Create a model attribute from a String request value (e.g. URI template
* Create a model attribute from a String request value (for example, URI template
* variable, request parameter) using type conversion.
* <p>The default implementation converts only if there is a registered
* {@link Converter} that can perform the conversion.

View File

@@ -27,7 +27,7 @@ import org.springframework.web.servlet.RequestToViewNameTranslator;
/**
* Handles return values of types {@code void} and {@code String} interpreting them
* as view name reference. As of 4.2, it also handles general {@code CharSequence}
* types, e.g. {@code StringBuilder} or Groovy's {@code GString}, as view names.
* types, for example, {@code StringBuilder} or Groovy's {@code GString}, as view names.
*
* <p>A {@code null} return value, either due to a {@code void} return type or
* as the actual return value is left as-is allowing the configured

View File

@@ -376,7 +376,7 @@ public class DefaultHandlerExceptionResolver extends AbstractHandlerExceptionRes
}
/**
* Handle the case when an unrecoverable binding exception occurs - e.g.
* Handle the case when an unrecoverable binding exception occurs - for example,
* required header, required cookie.
* <p>The default implementation returns {@code null} in which case the
* exception is handled in {@link #handleErrorResponse}.
@@ -641,7 +641,7 @@ public class DefaultHandlerExceptionResolver extends AbstractHandlerExceptionRes
/**
* Handle the case where method validation failed on a component that is
* not a web controller, e.g. on some underlying service.
* not a web controller, for example, on some underlying service.
* <p>The default implementation sends an HTTP 500 error, and returns an empty {@code ModelAndView}.
* Alternatively, a fallback view could be chosen, or the HttpMessageNotWritableException could
* be rethrown as-is.

View File

@@ -79,7 +79,7 @@ public abstract class AbstractVersionStrategy implements VersionStrategy {
/**
* A prefix-based {@code VersionPathStrategy},
* e.g. {@code "{version}/path/foo.js"}.
* for example, {@code "{version}/path/foo.js"}.
*/
protected static class PrefixVersionPathStrategy implements VersionPathStrategy {
@@ -116,7 +116,7 @@ public abstract class AbstractVersionStrategy implements VersionStrategy {
/**
* File name-based {@code VersionPathStrategy},
* e.g. {@code "path/foo-{version}.css"}.
* for example, {@code "path/foo-{version}.css"}.
*/
protected static class FileNameVersionPathStrategy implements VersionPathStrategy {

View File

@@ -24,7 +24,7 @@ import org.springframework.util.FileCopyUtils;
/**
* A {@code VersionStrategy} that calculates a Hex MD5 hash from the content
* of the resource and appends it to the file name, e.g.
* of the resource and appends it to the file name, for example,
* {@code "styles/main-e36d2e05253c6c7085a91522ce43a0b4.css"}.
*
* @author Brian Clozel

View File

@@ -36,7 +36,7 @@ import org.springframework.util.StringUtils;
/**
* A {@link ResourceTransformer} implementation that modifies links in a CSS
* file to match the public URL paths that should be exposed to clients (e.g.
* file to match the public URL paths that should be exposed to clients (for example,
* with an MD5 content-based hash inserted in the URL).
*
* <p>The implementation looks for links in CSS {@code @import} statements and
@@ -128,7 +128,7 @@ public class CssLinkResourceTransformer extends ResourceTransformerSupport {
*/
protected abstract static class AbstractLinkParser implements LinkParser {
/** Return the keyword to use to search for links, e.g. "@import", "url(" */
/** Return the keyword to use to search for links, for example, "@import", "url(". */
protected abstract String getKeyword();
@Override

View File

@@ -40,7 +40,7 @@ import org.springframework.util.Assert;
/**
* Resolver that delegates to the chain, and if a resource is found, it then
* attempts to find an encoded (e.g. gzip, brotli) variant that is acceptable
* attempts to find an encoded (for example, gzip, brotli) variant that is acceptable
* based on the "Accept-Encoding" request header.
*
* <p>The list of supported {@link #setContentCodings(List) contentCodings} can

View File

@@ -20,7 +20,7 @@ import org.springframework.core.io.Resource;
/**
* A {@code VersionStrategy} that relies on a fixed version applied as a request
* path prefix, e.g. reduced SHA, version name, release date, etc.
* path prefix, for example, reduced SHA, version name, release date, etc.
*
* <p>This is useful for example when {@link ContentVersionStrategy} cannot be
* used such as when using JavaScript module loaders which are in charge of

View File

@@ -58,7 +58,7 @@ public class LiteWebJarsResourceResolver extends AbstractResourceResolver {
/**
* Create a {@code LiteWebJarsResourceResolver} with a custom {@code WebJarVersionLocator} instance,
* e.g. with a custom cache implementation.
* for example, with a custom cache implementation.
*/
public LiteWebJarsResourceResolver(WebJarVersionLocator webJarVersionLocator) {
this.webJarVersionLocator = webJarVersionLocator;

View File

@@ -64,7 +64,7 @@ public class PathResourceResolver extends AbstractResourceResolver {
/**
* By default, when a Resource is found, the path of the resolved resource is
* compared to ensure it's under the input location where it was found.
* However sometimes that may not be the case, e.g. when
* However sometimes that may not be the case, for example, when
* {@link org.springframework.web.servlet.resource.CssLinkResourceTransformer}
* resolves public URLs of links it contains, the CSS file is the location
* and the resources being resolved are css files, images, fonts and others

View File

@@ -68,7 +68,7 @@ import org.springframework.web.util.UrlPathHelper;
* <p>The properties {@linkplain #setLocations "locations"} and
* {@linkplain #setLocationValues "locationValues"} accept locations from which
* static resources can be served by this handler. This can be relative to the
* root of the web application, or from the classpath, e.g.
* root of the web application, or from the classpath, for example,
* "classpath:/META-INF/public-web-resources/", allowing convenient packaging
* and serving of resources such as .js, .css, and others in jar files.
*
@@ -160,7 +160,7 @@ public class ResourceHttpRequestHandler extends WebContentGenerator
* {@code /META-INF/public-web-resources/} directory, with resources in the
* web application root taking precedence.
* <p>For {@link org.springframework.core.io.UrlResource URL-based resources}
* (e.g. files, HTTP URLs, etc.) this method supports a special prefix to
* (for example, files, HTTP URLs, etc.) this method supports a special prefix to
* indicate the charset associated with the URL so that relative paths
* appended to it can be encoded correctly, for example
* {@code "[charset=Windows-31J]https://example.org/path"}.
@@ -574,7 +574,7 @@ public class ResourceHttpRequestHandler extends WebContentGenerator
public void handleRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// For very general mappings (e.g. "/") we need to check 404 first
// For very general mappings (for example, "/") we need to check 404 first
Resource resource = getResource(request);
if (resource == null) {
logger.debug("Resource not found");

View File

@@ -34,7 +34,7 @@ public interface ResourceTransformerChain {
/**
* Return the {@code ResourceResolverChain} that was used to resolve the
* {@code Resource} being transformed. This may be needed for resolving
* related resources, e.g. links to other resources.
* related resources, for example, links to other resources.
*/
ResourceResolverChain getResolverChain();

View File

@@ -42,7 +42,7 @@ public abstract class ResourceTransformerSupport implements ResourceTransformer
/**
* Configure a {@link ResourceUrlProvider} to use when resolving the public
* URL of links in a transformed resource (e.g. import links in a CSS file).
* URL of links in a transformed resource (for example, import links in a CSS file).
* This is required only for links expressed as full paths and not for
* relative links.
*/
@@ -62,7 +62,7 @@ public abstract class ResourceTransformerSupport implements ResourceTransformer
/**
* A transformer can use this method when a resource being transformed
* contains links to other resources. Such links need to be replaced with the
* public facing link as determined by the resource resolver chain (e.g. the
* public facing link as determined by the resource resolver chain (for example, the
* public URL may have a version inserted).
* @param resourcePath the path to a resource that needs to be re-written
* @param request the current request

View File

@@ -43,7 +43,7 @@ import org.springframework.util.StringUtils;
/**
* Resolves request paths containing a version string that can be used as part
* of an HTTP caching strategy in which a resource is cached with a date in the
* distant future (e.g. 1 year) and cached until the version, and therefore the
* distant future (for example, 1 year) and cached until the version, and therefore the
* URL, is changed.
*
* <p>Different versioning strategies exist, and this resolver must be configured
@@ -93,7 +93,7 @@ public class VersionResourceResolver extends AbstractResourceResolver {
/**
* Insert a content-based version in resource URLs that match the given path
* patterns. The version is computed from the content of the file, e.g.
* patterns. The version is computed from the content of the file, for example,
* {@code "css/main-e36d2e05253c6c7085a91522ce43a0b4.css"}. This is a good
* default strategy to use except when it cannot be, for example when using
* JavaScript module loaders, use {@link #addFixedVersionStrategy} instead
@@ -114,7 +114,7 @@ public class VersionResourceResolver extends AbstractResourceResolver {
* content-based versions) when using JavaScript module loaders.
* <p>The version may be a random number, the current date, or a value
* fetched from a git commit sha, a property file, or environment variable
* and set with SpEL expressions in the configuration (e.g. see {@code @Value}
* and set with SpEL expressions in the configuration (for example, see {@code @Value}
* in Java config).
* <p>If not done already, variants of the given {@code pathPatterns}, prefixed with
* the {@code version} will be also configured. For example, adding a {@code "/js/**"} path pattern

View File

@@ -69,7 +69,7 @@ public class WebJarsResourceResolver extends AbstractResourceResolver {
/**
* Create a {@code WebJarsResourceResolver} with a custom {@code WebJarAssetLocator} instance,
* e.g. with a custom index.
* for example, with a custom index.
* @since 4.3
*/
public WebJarsResourceResolver(WebJarAssetLocator webJarAssetLocator) {

View File

@@ -89,7 +89,7 @@ public class BindStatus {
* Create a new BindStatus instance, representing a field or object status.
* @param requestContext the current RequestContext
* @param path the bean and property path for which values and errors
* will be resolved (e.g. "customer.address.street")
* will be resolved (for example, "customer.address.street")
* @param htmlEscape whether to HTML-escape error messages and string values
* @throws IllegalStateException if no corresponding Errors object found
*/
@@ -183,7 +183,7 @@ public class BindStatus {
/**
* Return the bean and property path for which values and errors
* will be resolved (e.g. "customer.address.street").
* will be resolved (for example, "customer.address.street").
*/
public String getPath() {
return this.path;
@@ -192,7 +192,7 @@ public class BindStatus {
/**
* Return a bind expression that can be used in HTML forms as input name
* for the respective field, or {@code null} if not field-specific.
* <p>Returns a bind path appropriate for resubmission, e.g. "address.street".
* <p>Returns a bind path appropriate for resubmission, for example, "address.street".
* Note that the complete bind path as required by the bind tag is
* "customer.address.street", if bound to a "customer" bean.
*/
@@ -289,7 +289,7 @@ public class BindStatus {
/**
* Return an error message string, concatenating all messages
* separated by the given delimiter.
* @param delimiter separator string, e.g. ", " or "<br>"
* @param delimiter separator string, for example, ", " or "<br>"
* @return the error message string
*/
public String getErrorMessagesAsString(String delimiter) {

View File

@@ -716,7 +716,7 @@ public class RequestContext {
}
/**
* Retrieve the given MessageSourceResolvable (e.g. an ObjectError instance), using the "defaultHtmlEscape" setting.
* Retrieve the given MessageSourceResolvable (for example, an ObjectError instance), using the "defaultHtmlEscape" setting.
* @param resolvable the MessageSourceResolvable
* @return the message
* @throws org.springframework.context.NoSuchMessageException if not found
@@ -726,7 +726,7 @@ public class RequestContext {
}
/**
* Retrieve the given MessageSourceResolvable (e.g. an ObjectError instance).
* Retrieve the given MessageSourceResolvable (for example, an ObjectError instance).
* @param resolvable the MessageSourceResolvable
* @param htmlEscape if the message should be HTML-escaped
* @return the message
@@ -909,7 +909,7 @@ public class RequestContext {
/**
* Create a BindStatus for the given bind object, using the "defaultHtmlEscape" setting.
* @param path the bean and property path for which values and errors will be resolved (e.g. "person.age")
* @param path the bean and property path for which values and errors will be resolved (for example, "person.age")
* @return the new BindStatus instance
* @throws IllegalStateException if no corresponding Errors object found
*/
@@ -919,7 +919,7 @@ public class RequestContext {
/**
* Create a BindStatus for the given bind object, using the "defaultHtmlEscape" setting.
* @param path the bean and property path for which values and errors will be resolved (e.g. "person.age")
* @param path the bean and property path for which values and errors will be resolved (for example, "person.age")
* @param htmlEscape create a BindStatus with automatic HTML escaping?
* @return the new BindStatus instance
* @throws IllegalStateException if no corresponding Errors object found

View File

@@ -85,8 +85,8 @@ public class ServletUriComponentsBuilder extends UriComponentsBuilder {
/**
* Prepare a builder from the host, port, scheme, context path, and
* servlet mapping of the given HttpServletRequest.
* <p>If the servlet is mapped by name, e.g. {@code "/main/*"}, the path
* will end with "/main". If the servlet is mapped otherwise, e.g.
* <p>If the servlet is mapped by name, for example, {@code "/main/*"}, the path
* will end with "/main". If the servlet is mapped otherwise, for example,
* {@code "/"} or {@code "*.do"}, the result will be the same as
* if calling {@link #fromContextPath(HttpServletRequest)}.
*/

View File

@@ -238,7 +238,7 @@ public abstract class WebContentGenerator extends WebApplicationObjectSupport {
}
/**
* Configure one or more request header names (e.g. "Accept-Language") to
* Configure one or more request header names (for example, "Accept-Language") to
* add to the "Vary" response header to inform clients that the response is
* subject to content negotiation and variances based on the value of the
* given request headers. The configured request header names are added only

View File

@@ -108,8 +108,8 @@ public class BindTag extends HtmlEscapingAwareTag implements EditorAwareTag {
/**
* Set the path that this tag should apply. Can be a bean (e.g. "person")
* to get global errors, or a bean property (e.g. "person.name") to get
* Set the path that this tag should apply. Can be a bean (for example, "person")
* to get global errors, or a bean property (for example, "person.name") to get
* field errors (also supporting nested fields and "person.na*" mappings).
* "person.*" will return all errors for the specified bean, both global
* and field errors.

View File

@@ -31,7 +31,7 @@ import org.springframework.web.util.JavaScriptUtils;
* applying HTML escaping and/or JavaScript escaping.
*
* <p>Provides a "htmlEscape" property for explicitly specifying whether to
* apply HTML escaping. If not set, a page-level default (e.g. from the
* apply HTML escaping. If not set, a page-level default (for example, from the
* HtmlEscapeTag) or an application-wide default (the "defaultHtmlEscape"
* context-param in web.xml) is used.
*
@@ -132,7 +132,7 @@ public class EscapeBodyTag extends HtmlEscapingAwareTag implements BodyTag {
/**
* Write the escaped body content to the page.
* <p>Can be overridden in subclasses, e.g. for testing purposes.
* <p>Can be overridden in subclasses, for example, for testing purposes.
* @param content the content to write
* @throws IOException if writing failed
*/

View File

@@ -25,7 +25,7 @@ import org.springframework.web.util.HtmlUtils;
* Superclass for tags that output content that might get HTML-escaped.
*
* <p>Provides a "htmlEscape" property for explicitly specifying whether to
* apply HTML escaping. If not set, a page-level default (e.g. from the
* apply HTML escaping. If not set, a page-level default (for example, from the
* HtmlEscapeTag) or an application-wide default (the "defaultHtmlEscape"
* context-param in {@code web.xml}) is used.
*

View File

@@ -378,7 +378,7 @@ public class MessageTag extends HtmlEscapingAwareTag implements ArgumentAware {
/**
* Write the message to the page.
* <p>Can be overridden in subclasses, e.g. for testing purposes.
* <p>Can be overridden in subclasses, for example, for testing purposes.
* @param msg the message to write
* @throws IOException if writing failed
*/

View File

@@ -50,7 +50,7 @@ import org.springframework.lang.Nullable;
* <td>path</td>
* <td>true</td>
* <td>true</td>
* <td>Set the path that this tag should apply. E.g. 'customer' to allow bind
* <td>Set the path that this tag should apply. For example, 'customer' to allow bind
* paths like 'address.street' rather than 'customer.address.street'.</td>
* </tr>
* </tbody>
@@ -78,7 +78,7 @@ public class NestedPathTag extends TagSupport implements TryCatchFinally {
/**
* Set the path that this tag should apply.
* <p>E.g. "customer" to allow bind paths like "address.street"
* <p>For example, "customer" to allow bind paths like "address.street"
* rather than "customer.address.street".
* @see BindTag#setPath
*/

View File

@@ -135,10 +135,10 @@ public class TransformTag extends HtmlEscapingAwareTag {
@Override
protected final int doStartTagInternal() throws JspException {
if (this.value != null) {
// Find the containing EditorAwareTag (e.g. BindTag), if applicable.
// Find the containing EditorAwareTag (for example, BindTag), if applicable.
EditorAwareTag tag = (EditorAwareTag) TagSupport.findAncestorWithClass(this, EditorAwareTag.class);
if (tag == null) {
throw new JspException("TransformTag can only be used within EditorAwareTag (e.g. BindTag)");
throw new JspException("TransformTag can only be used within EditorAwareTag (for example, BindTag)");
}
// OK, let's obtain the editor...

View File

@@ -33,7 +33,7 @@ import org.springframework.web.util.WebUtils;
* This is particularly useful for stateless applications without user sessions.
*
* <p>Custom controllers can thus override the user's theme by calling
* {@code setThemeName}, e.g. responding to a certain theme change request.
* {@code setThemeName}, for example, responding to a certain theme change request.
*
* @author Jean-Pierre Pawlak
* @author Juergen Hoeller

View File

@@ -30,7 +30,7 @@ import org.springframework.web.util.WebUtils;
* application needs user sessions anyway.
*
* <p>Custom controllers can override the user's theme by calling
* {@code setThemeName}, e.g. responding to a theme change request.
* {@code setThemeName}, for example, responding to a theme change request.
*
* @author Jean-Pierre Pawlak
* @author Juergen Hoeller

View File

@@ -133,7 +133,7 @@ public abstract class AbstractCachingViewResolver extends WebApplicationObjectSu
* Note that this flag only applies if the general {@link #setCache "cache"}
* flag is kept at its default of "true" as well.
* <p>Of specific interest is the ability for some {@link AbstractUrlBasedView}
* implementations (e.g., FreeMarker) to check if an underlying resource
* implementations (for example, FreeMarker) to check if an underlying resource
* exists via {@link AbstractUrlBasedView#checkResource(Locale)}.
* With this flag set to "false", an underlying resource that re-appears
* is noticed and used. With the flag set to "true", only one check is made.
@@ -219,7 +219,7 @@ public abstract class AbstractCachingViewResolver extends WebApplicationObjectSu
/**
* Provides functionality to clear the cache for a certain view.
* <p>This can be handy in case developers are able to modify views
* (e.g., FreeMarker templates) at runtime after which you'd need to
* (for example, FreeMarker templates) at runtime after which you'd need to
* clear the cache for the specified view.
* @param viewName the view name for which the cached view object
* (if any) needs to be removed

View File

@@ -47,7 +47,7 @@ public abstract class AbstractTemplateView extends AbstractUrlBasedView {
/**
* Variable name of the RequestContext instance in the template model,
* available to Spring's macros: e.g. for creating BindStatus objects.
* available to Spring's macros: for example, for creating BindStatus objects.
*/
public static final String SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE = "springMacroRequestContext";
@@ -67,7 +67,7 @@ public abstract class AbstractTemplateView extends AbstractUrlBasedView {
* Set whether all request attributes should be added to the
* model prior to merging with the template. Default is "false".
* <p>Note that some templates may make request attributes visible
* on their own, e.g. FreeMarker, without exposure in the MVC model.
* on their own, for example, FreeMarker, without exposure in the MVC model.
*/
public void setExposeRequestAttributes(boolean exposeRequestAttributes) {
this.exposeRequestAttributes = exposeRequestAttributes;

View File

@@ -87,7 +87,7 @@ public abstract class AbstractUrlBasedView extends AbstractView implements Initi
* @param locale the desired Locale that we're looking for
* @return {@code true} if the resource exists (or is assumed to exist);
* {@code false} if we know that it does not exist
* @throws Exception if the resource exists but is invalid (e.g. could not be parsed)
* @throws Exception if the resource exists but is invalid (for example, could not be parsed)
*/
public boolean checkResource(Locale locale) throws Exception {
return true;

View File

@@ -92,7 +92,7 @@ public abstract class AbstractView extends WebApplicationObjectSupport implement
* Set the content type for this view.
* Default is "text/html;charset=ISO-8859-1".
* <p>May be ignored by subclasses if the view itself is assumed
* to set the content type, e.g. in case of JSPs.
* to set the content type, for example, in case of JSPs.
*/
public void setContentType(@Nullable String contentType) {
this.contentType = contentType;

View File

@@ -30,7 +30,7 @@ import org.springframework.util.ClassUtils;
* JSTL API is present.
*
* <p>BTW, it's good practice to put JSP files that just serve as views under
* WEB-INF, to hide them from direct access (e.g. via a manually entered URL).
* WEB-INF, to hide them from direct access (for example, via a manually entered URL).
* Only controllers will be able to access them then.
*
* <p><b>Note:</b> When chaining ViewResolvers, an InternalResourceViewResolver

View File

@@ -64,7 +64,7 @@ import org.springframework.web.servlet.support.RequestContext;
*
* <p>Hint: Set the {@link #setExposeContextBeansAsAttributes} flag to "true"
* in order to make all Spring beans in the application context accessible
* within JSTL expressions (e.g. in a {@code c:out} value expression).
* within JSTL expressions (for example, in a {@code c:out} value expression).
* This will also make all such beans accessible in plain {@code ${...}}
* expressions in a JSP 2.0 page.
*

View File

@@ -53,12 +53,12 @@ import org.springframework.web.servlet.View;
* "/WEB-INF/jsp/test.jsp"
*
* <p>As a special feature, redirect URLs can be specified via the "redirect:"
* prefix. E.g.: "redirect:myAction" will trigger a redirect to the given
* prefix. For example: "redirect:myAction" will trigger a redirect to the given
* URL, rather than resolution as standard view name. This is typically used
* for redirecting to a controller URL after finishing a form workflow.
*
* <p>Furthermore, forward URLs can be specified via the "forward:" prefix.
* E.g.: "forward:myAction" will trigger a forward to the given URL, rather than
* For example: "forward:myAction" will trigger a forward to the given URL, rather than
* resolution as standard view name. This is typically used for controller URLs;
* it is not supposed to be used for JSP URLs - use logical view names there.
*
@@ -221,7 +221,7 @@ public class UrlBasedViewResolver extends AbstractCachingViewResolver implements
* interpreted as relative to the web application root, i.e. the context
* path will be prepended to the URL.
* <p><b>Redirect URLs can be specified via the "redirect:" prefix.</b>
* E.g.: "redirect:myAction"
* For example: "redirect:myAction"
* @see RedirectView#setContextRelative
* @see #REDIRECT_URL_PREFIX
*/
@@ -248,7 +248,7 @@ public class UrlBasedViewResolver extends AbstractCachingViewResolver implements
* difference. However, some clients depend on 303 when redirecting
* after a POST request; turn this flag off in such a scenario.
* <p><b>Redirect URLs can be specified via the "redirect:" prefix.</b>
* E.g.: "redirect:myAction"
* For example: "redirect:myAction"
* @see RedirectView#setHttp10Compatible
* @see #REDIRECT_URL_PREFIX
*/

View File

@@ -109,7 +109,7 @@ public abstract class AbstractPdfStamperView extends AbstractUrlBasedView {
* @param model the model Map
* @param stamper the PdfStamper instance that will contain the AcroFields.
* You may also customize this PdfStamper instance according to your needs,
* e.g. setting the "formFlattening" property.
* for example, setting the "formFlattening" property.
* @param request in case we need locale etc. Shouldn't look at attributes.
* @param response in case we need to set cookies. Shouldn't write to it.
* @throws Exception any exception that occurred during document building

View File

@@ -257,7 +257,7 @@
<variable-class>java.lang.String</variable-class>
</variable>
<attribute>
<description>Set the path that this tag should apply. E.g. 'customer'
<description>Set the path that this tag should apply. For example, 'customer'
to allow bind paths like 'address.street' rather than
'customer.address.street'.</description>
<name>path</name>

View File

@@ -252,7 +252,7 @@
By default, a SimpleAsyncTaskExecutor is used which does not re-use threads and is not recommended for production.
As of 5.0 this executor is also used when a controller returns a reactive type that does streaming
(e.g. "text/event-stream" or "application/x-ndjson") for the blocking writes to the
(for example, "text/event-stream" or "application/x-ndjson") for the blocking writes to the
"jakarta.servlet.ServletOutputStream".
]]></xsd:documentation>
@@ -364,7 +364,7 @@
<xsd:annotation>
<xsd:documentation source="org.springframework.web.servlet.resource.ContentVersionStrategy"><![CDATA[
A VersionStrategy that calculates an Hex MD5 hashes from the content of the resource and appends it
to the file name, e.g. "styles/main-e36d2e05253c6c7085a91522ce43a0b4.css".
to the file name, for example, "styles/main-e36d2e05253c6c7085a91522ce43a0b4.css".
]]></xsd:documentation>
</xsd:annotation>
<xsd:attribute name="patterns" type="xsd:string" use="required"/>
@@ -374,7 +374,7 @@
<xsd:annotation>
<xsd:documentation source="org.springframework.web.servlet.resource.FixedVersionStrategy"><![CDATA[
A VersionStrategy that relies on a fixed version applied as a request path prefix,
e.g. reduced SHA, version name, release date, etc.
for example, reduced SHA, version name, release date, etc.
]]></xsd:documentation>
</xsd:annotation>
<xsd:attribute name="version" type="xsd:string" use="required"/>
@@ -410,7 +410,7 @@
<xsd:annotation>
<xsd:documentation source="org.springframework.web.servlet.resource.VersionResourceResolver"><![CDATA[
Resolves request paths containing a version string that can be used as part of an HTTP caching strategy
in which a resource is cached with a far future date (e.g. 1 year) and cached until the version,
in which a resource is cached with a far future date (for example, 1 year) and cached until the version,
and therefore the URL, is changed.
]]></xsd:documentation>
</xsd:annotation>
@@ -655,9 +655,9 @@
"/, classpath:/META-INF/public-web-resources/" will allow resources to be served both from the web app
root and from any JAR on the classpath that contains a /META-INF/public-web-resources/ directory,
with resources in the web app root taking precedence.
For URL-based resources (e.g. files, HTTP URLs, etc) this property supports a special prefix to
For URL-based resources (for example, files, HTTP URLs, etc) this property supports a special prefix to
indicate the charset associated with the URL so that relative paths appended to it can be encoded
correctly, e.g. "[charset=Windows-31J]https://example.org/path".
correctly, for example, "[charset=Windows-31J]https://example.org/path".
]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
@@ -1280,7 +1280,7 @@
<xsd:attribute name="allowed-origins" type="xsd:string">
<xsd:annotation>
<xsd:documentation><![CDATA[
Comma-separated list of origins to allow, e.g. "https://domain1.com, https://domain2.com".
Comma-separated list of origins to allow, for example, "https://domain1.com, https://domain2.com".
The special value "*" allows all domains (default).
For matching pre-flight and actual requests the "Access-Control-Allow-Origin"
@@ -1305,7 +1305,7 @@
<xsd:documentation><![CDATA[
Alternative to allowed-origins that supports origins declared via patterns.
In contrast to allowed-origins which does support the special value "*", this
property allows more flexible patterns, e.g. "*.domain1.com". Furthermore it
property allows more flexible patterns, for example, "*.domain1.com". Furthermore it
always sets the "Access-Control-Allow-Origin" response header to the matched
origin and never to "*" nor to any other pattern and therefore can be used in
combination with allowCredentials set to true.
@@ -1317,7 +1317,7 @@
<xsd:attribute name="allowed-methods" type="xsd:string">
<xsd:annotation>
<xsd:documentation><![CDATA[
Comma-separated list of HTTP methods to allow, e.g. "GET, POST".
Comma-separated list of HTTP methods to allow, for example, "GET, POST".
The special value "*" allows all method.
By default GET, HEAD and POST methods are allowed.
]]></xsd:documentation>

View File

@@ -92,8 +92,8 @@
* bind
*
* Exposes a BindStatus object for the given bind path, which can be
* a bean (e.g. "person") to get global errors, or a bean property
* (e.g. "person.name") to get field errors. Can be called multiple times
* a bean (for example, "person") to get global errors, or a bean property
* (for example, "person.name") to get field errors. Can be called multiple times
* within a form to bind to multiple command objects and/or field names.
*
* This macro will participate in the default HTML escape setting for the given

View File

@@ -562,7 +562,7 @@ class ServletAnnotationControllerHandlerMethodTests extends AbstractServletHandl
if (!usePathPatterns) {
// This depends on suffix pattern matching and has different outcomes otherwise,
// e.g. 404 vs another method matching, depending on the test case.
// for example, 404 vs another method matching, depending on the test case.
assertThat(response.getContentAsString()).isEqualTo("test-name1-2");
}

View File

@@ -688,7 +688,7 @@ public class SelectTagTests extends AbstractFormTagTests {
// Save original default locale.
final Locale defaultLocale = Locale.getDefault();
// Use a locale that doesn't result in the generation of HTML entities
// (e.g., not German, where \u00e4 becomes &auml;)
// (for example, not German, where \u00e4 becomes &auml;)
Locale.setDefault(Locale.US);
try {