Replace 'e.g.' with 'for example' in documentation and comments
Closes gh-33515
This commit is contained in:
committed by
Sam Brannen
parent
e55fe9077f
commit
8941e2876e
@@ -698,7 +698,7 @@ public final class ContentDisposition {
|
||||
* Set the value of the {@literal filename} parameter. The given
|
||||
* filename will be formatted as quoted-string, as defined in RFC 2616,
|
||||
* section 2.2, and any quote characters within the filename value will
|
||||
* be escaped with a backslash, e.g. {@code "foo\"bar.txt"} becomes
|
||||
* be escaped with a backslash, for example, {@code "foo\"bar.txt"} becomes
|
||||
* {@code "foo\\\"bar.txt"}.
|
||||
*/
|
||||
Builder filename(@Nullable String filename);
|
||||
|
||||
@@ -1418,7 +1418,7 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the request header names (e.g. "Accept-Language") for which the
|
||||
* Set the request header names (for example, "Accept-Language") for which the
|
||||
* response is subject to content negotiation and variances based on the
|
||||
* value of those request headers.
|
||||
* @param requestHeaders the request header names
|
||||
|
||||
@@ -129,7 +129,7 @@ public final class HttpMethod implements Comparable<HttpMethod>, Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* Return the name of this method, e.g. "GET", "POST".
|
||||
* Return the name of this method, for example, "GET", "POST".
|
||||
*/
|
||||
public String name() {
|
||||
return this.name;
|
||||
|
||||
@@ -79,7 +79,7 @@ public sealed interface HttpStatusCode extends Serializable permits DefaultHttpS
|
||||
/**
|
||||
* Whether this {@code HttpStatusCode} shares the same integer {@link #value() value} as the other status code.
|
||||
* <p>Useful for comparisons that take deprecated aliases into account or compare arbitrary implementations
|
||||
* of {@code HttpStatusCode} (e.g. in place of {@link HttpStatus#equals(Object) HttpStatus enum equality}).
|
||||
* of {@code HttpStatusCode} (for example, in place of {@link HttpStatus#equals(Object) HttpStatus enum equality}).
|
||||
* @param other the other {@code HttpStatusCode} to compare
|
||||
* @return true if the two {@code HttpStatusCode} objects share the same integer {@code value()}, false otherwise
|
||||
* @since 6.0.5
|
||||
|
||||
@@ -286,7 +286,7 @@ public class MediaType extends MimeType implements Serializable {
|
||||
* @deprecated as of 5.3 since it originates from the W3C Activity Streams
|
||||
* specification which has a more specific purpose and has been since
|
||||
* replaced with a different mime type. Use {@link #APPLICATION_NDJSON} as
|
||||
* a replacement or any other line-delimited JSON format (e.g. JSON Lines,
|
||||
* a replacement or any other line-delimited JSON format (for example, JSON Lines,
|
||||
* JSON Text Sequences).
|
||||
*/
|
||||
@Deprecated
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.springframework.util.StringUtils;
|
||||
/**
|
||||
* {@link java.beans.PropertyEditor Editor} for {@link MediaType}
|
||||
* descriptors, to automatically convert {@code String} specifications
|
||||
* (e.g. {@code "text/html"}) to {@code MediaType} properties.
|
||||
* (for example, {@code "text/html"}) to {@code MediaType} properties.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 3.0
|
||||
|
||||
@@ -37,7 +37,7 @@ import org.springframework.util.ObjectUtils;
|
||||
*
|
||||
* <p>For an extended response, an application can also create a subclass with
|
||||
* additional properties. Subclasses can use the protected copy constructor to
|
||||
* re-create an existing {@code ProblemDetail} instance as the subclass, e.g.
|
||||
* re-create an existing {@code ProblemDetail} instance as the subclass, for example,
|
||||
* from an {@code @ControllerAdvice} such as
|
||||
* {@link org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler} or
|
||||
* {@link org.springframework.web.reactive.result.method.annotation.ResponseEntityExceptionHandler}.
|
||||
|
||||
@@ -46,7 +46,7 @@ public interface ReactiveHttpOutputMessage extends HttpMessage {
|
||||
/**
|
||||
* Register an action to apply just before the HttpOutputMessage is committed.
|
||||
* <p><strong>Note:</strong> the supplied action must be properly deferred,
|
||||
* e.g. via {@link Mono#defer} or {@link Mono#fromRunnable}, to ensure it's
|
||||
* for example, via {@link Mono#defer} or {@link Mono#fromRunnable}, to ensure it's
|
||||
* executed in the right order, relative to other actions.
|
||||
* @param action the action to apply
|
||||
*/
|
||||
|
||||
@@ -229,7 +229,7 @@ public final class ResponseCookie extends HttpCookie {
|
||||
/**
|
||||
* Factory method to obtain a builder for a server-defined cookie. Unlike
|
||||
* {@link #from(String, String)} this option assumes input from a remote
|
||||
* server, which can be handled more leniently, e.g. ignoring an empty domain
|
||||
* server, which can be handled more leniently, for example, ignoring an empty domain
|
||||
* name with double quotes.
|
||||
* @param name the cookie name
|
||||
* @param value the cookie value
|
||||
|
||||
@@ -458,7 +458,7 @@ public class ResponseEntity<T> extends HttpEntity<T> {
|
||||
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
|
||||
|
||||
@@ -63,7 +63,7 @@ import org.springframework.util.MultiValueMap;
|
||||
* Resource image = new ClassPathResource("image.jpg");
|
||||
* builder.part("image", image).header("foo", "bar");
|
||||
*
|
||||
* // Add content (e.g. JSON)
|
||||
* // Add content (for example, JSON)
|
||||
* Account account = ...
|
||||
* builder.part("account", account).header("foo", "bar");
|
||||
*
|
||||
@@ -104,7 +104,7 @@ public final class MultipartBodyBuilder {
|
||||
* <ul>
|
||||
* <li>String -- form field
|
||||
* <li>{@link org.springframework.core.io.Resource Resource} -- file part
|
||||
* <li>Object -- content to be encoded (e.g. to JSON)
|
||||
* <li>Object -- content to be encoded (for example, to JSON).
|
||||
* <li>{@link HttpEntity} -- part content and headers although generally it's
|
||||
* easier to add headers through the returned builder
|
||||
* <li>{@link Part} -- a part from a server request
|
||||
|
||||
@@ -39,9 +39,9 @@ import org.springframework.lang.Nullable;
|
||||
* <p>HTTP message readers and writers are divided into 3 categories that are
|
||||
* ordered as follows:
|
||||
* <ol>
|
||||
* <li>Typed readers and writers that support specific types, e.g. byte[], String.
|
||||
* <li>Object readers and writers, e.g. JSON, XML.
|
||||
* <li>Catch-all readers or writers, e.g. String with any media type.
|
||||
* <li>Typed readers and writers that support specific types, for example, byte[], String.
|
||||
* <li>Object readers and writers, for example, JSON, XML.
|
||||
* <li>Catch-all readers or writers, for example, String with any media type.
|
||||
* </ol>
|
||||
*
|
||||
* <p>Typed and object readers are further subdivided and ordered as follows:
|
||||
@@ -241,7 +241,7 @@ public interface CodecConfigurer {
|
||||
* decoding to a single {@code DataBuffer},
|
||||
* {@link java.nio.ByteBuffer ByteBuffer}, {@code byte[]},
|
||||
* {@link org.springframework.core.io.Resource Resource}, {@code String}, etc.
|
||||
* It can also occur when splitting the input stream, e.g. delimited text,
|
||||
* It can also occur when splitting the input stream, for example, delimited text,
|
||||
* in which case the limit applies to data buffered between delimiters.
|
||||
* <p>By default this is not set, in which case individual codec defaults
|
||||
* apply. All codecs are limited to 256K by default.
|
||||
|
||||
@@ -60,7 +60,7 @@ public abstract class KotlinSerializationBinaryDecoder<T extends BinaryFormat> e
|
||||
* decoding to a single {@code DataBuffer},
|
||||
* {@link java.nio.ByteBuffer ByteBuffer}, {@code byte[]},
|
||||
* {@link org.springframework.core.io.Resource Resource}, {@code String}, etc.
|
||||
* It can also occur when splitting the input stream, e.g. delimited text,
|
||||
* It can also occur when splitting the input stream, for example, delimited text,
|
||||
* in which case the limit applies to data buffered between delimiters.
|
||||
* <p>By default this is set to 256K.
|
||||
* @param byteCount the max number of bytes to buffer, or -1 for unlimited
|
||||
|
||||
@@ -61,7 +61,7 @@ public abstract class KotlinSerializationStringDecoder<T extends StringFormat> e
|
||||
* decoding to a single {@code DataBuffer},
|
||||
* {@link java.nio.ByteBuffer ByteBuffer}, {@code byte[]},
|
||||
* {@link org.springframework.core.io.Resource Resource}, {@code String}, etc.
|
||||
* It can also occur when splitting the input stream, e.g. delimited text,
|
||||
* It can also occur when splitting the input stream, for example, delimited text,
|
||||
* in which case the limit applies to data buffered between delimiters.
|
||||
* <p>By default this is set to 256K.
|
||||
* @param byteCount the max number of bytes to buffer, or -1 for unlimited
|
||||
|
||||
@@ -29,7 +29,7 @@ import org.springframework.http.HttpHeaders;
|
||||
* part is either a {@link FormFieldPart} or a {@link FilePart}.
|
||||
*
|
||||
* <p>Multipart requests may also be used outside a browser for data of any
|
||||
* content type (e.g. JSON, PDF, etc).
|
||||
* content type (for example, JSON, PDF, etc).
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @author Rossen Stoyanchev
|
||||
|
||||
@@ -48,7 +48,7 @@ import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Implementation of {@link HttpMessageConverter} to read and write 'normal' HTML
|
||||
* forms and also to write (but not read) multipart data (e.g. file uploads).
|
||||
* forms and also to write (but not read) multipart data (for example, file uploads).
|
||||
*
|
||||
* <p>In other words, this converter can read and write the
|
||||
* {@code "application/x-www-form-urlencoded"} media type as
|
||||
|
||||
@@ -36,7 +36,7 @@ import org.springframework.http.converter.HttpMessageNotWritableException;
|
||||
import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* Common base class for plain JSON converters, e.g. Gson and JSON-B.
|
||||
* Common base class for plain JSON converters, for example, Gson and JSON-B.
|
||||
*
|
||||
* <p>Note that the Jackson converters have a dedicated class hierarchy
|
||||
* due to their multi-format support.
|
||||
|
||||
@@ -96,7 +96,7 @@ public class GsonHttpMessageConverter extends AbstractJsonHttpMessageConverter {
|
||||
protected void writeInternal(Object object, @Nullable Type type, Writer writer) throws Exception {
|
||||
// In Gson, toJson with a type argument will exclusively use that given type,
|
||||
// ignoring the actual type of the object... which might be more specific,
|
||||
// e.g. a subclass of the specified type which includes additional fields.
|
||||
// for example, a subclass of the specified type which includes additional fields.
|
||||
// As a consequence, we're only passing in parameterized type declarations
|
||||
// which might contain extra generics that the object instance doesn't retain.
|
||||
if (type instanceof ParameterizedType) {
|
||||
|
||||
@@ -267,7 +267,7 @@ public class Jackson2ObjectMapperBuilder {
|
||||
/**
|
||||
* Alternative to {@link #annotationIntrospector(AnnotationIntrospector)}
|
||||
* that allows combining with rather than replacing the currently set
|
||||
* introspector, e.g. via
|
||||
* introspector, for example, via
|
||||
* {@link AnnotationIntrospectorPair#pair(AnnotationIntrospector, AnnotationIntrospector)}.
|
||||
* @param pairingFunction a function to apply to the currently set
|
||||
* introspector (possibly {@code null}); the result of the function becomes
|
||||
|
||||
@@ -142,7 +142,7 @@ public class ServletServerHttpResponse implements ServerHttpResponse {
|
||||
*
|
||||
* <p>The intent is merely to expose what is available through the HttpServletResponse
|
||||
* i.e. the ability to look up specific header values by name. All other
|
||||
* map-related operations (e.g. iteration, removal, etc) apply only to values
|
||||
* map-related operations (for example, iteration, removal, etc) apply only to values
|
||||
* added directly through HttpHeaders methods.
|
||||
*
|
||||
* @since 4.0.3
|
||||
|
||||
@@ -63,7 +63,7 @@ public class ContextPathCompositeHandler implements HttpHandler {
|
||||
|
||||
@Override
|
||||
public Mono<Void> handle(ServerHttpRequest request, ServerHttpResponse response) {
|
||||
// Remove underlying context path first (e.g. Servlet container)
|
||||
// Remove underlying context path first (for example, Servlet container)
|
||||
String path = request.getPath().pathWithinApplication().value();
|
||||
return this.handlerMap.entrySet().stream()
|
||||
.filter(entry -> path.startsWith(entry.getKey()))
|
||||
|
||||
@@ -148,7 +148,7 @@ public class ServletHttpHandlerAdapter implements Servlet {
|
||||
|
||||
throw new IllegalArgumentException("Expected a single Servlet mapping: " +
|
||||
"either the default Servlet mapping (i.e. '/'), " +
|
||||
"or a path based mapping (e.g. '/*', '/foo/*'). " +
|
||||
"or a path based mapping (for example, '/*', '/foo/*'). " +
|
||||
"Actual mappings: " + mappings + " for Servlet '" + name + "'");
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ public class ServletHttpHandlerAdapter implements Servlet {
|
||||
}
|
||||
catch (IllegalStateException ex) {
|
||||
// Ignore: AsyncContext recycled and should not be used
|
||||
// e.g. TIMEOUT_LISTENER (above) may have completed the AsyncContext
|
||||
// for example, TIMEOUT_LISTENER (above) may have completed the AsyncContext
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ import org.springframework.lang.Nullable;
|
||||
* interface and a convenient base class for other exceptions to use.
|
||||
*
|
||||
* <p>{@code ErrorResponse} is supported as a return value from
|
||||
* {@code @ExceptionHandler} methods that render directly to the response, e.g.
|
||||
* {@code @ExceptionHandler} methods that render directly to the response, for example,
|
||||
* by being marked {@code @ResponseBody}, or declared in an
|
||||
* {@code @RestController} or {@code RestControllerAdvice} class.
|
||||
*
|
||||
@@ -62,7 +62,7 @@ public interface ErrorResponse {
|
||||
* {@link ProblemDetail} whose {@link ProblemDetail#getStatus() status}
|
||||
* should match the response status.
|
||||
* <p><strong>Note:</strong> The returned {@code ProblemDetail} may be
|
||||
* updated before the response is rendered, e.g. via
|
||||
* updated before the response is rendered, for example, via
|
||||
* {@link #updateAndGetBody(MessageSource, Locale)}. Therefore, implementing
|
||||
* methods should use an instance field, and should not re-create the
|
||||
* {@code ProblemDetail} on every call, nor use a static variable.
|
||||
@@ -107,7 +107,7 @@ public interface ErrorResponse {
|
||||
* Return arguments to use along with a {@link #getDetailMessageCode()
|
||||
* message code} to resolve the problem "detail" for this exception
|
||||
* through a {@link MessageSource}. The arguments are expanded
|
||||
* into placeholders of the message value, e.g. "Invalid content type {0}".
|
||||
* into placeholders of the message value, for example, "Invalid content type {0}".
|
||||
*/
|
||||
@Nullable
|
||||
default Object[] getDetailMessageArguments() {
|
||||
@@ -180,7 +180,7 @@ public interface ErrorResponse {
|
||||
/**
|
||||
* Build a message code for the "detail" field, for the given exception type.
|
||||
* @param exceptionType the exception type associated with the problem
|
||||
* @param suffix an optional suffix, e.g. for exceptions that may have multiple
|
||||
* @param suffix an optional suffix, for example, for exceptions that may have multiple
|
||||
* error message with different arguments
|
||||
* @return {@code "problemDetail."} followed by the fully qualified
|
||||
* {@link Class#getName() class name} and an optional suffix
|
||||
|
||||
@@ -87,7 +87,7 @@ import jakarta.servlet.ServletException;
|
||||
* <p>Most major Spring Web components have been updated to support this style of
|
||||
* registration. You'll find that {@code DispatcherServlet}, {@code FrameworkServlet},
|
||||
* {@code ContextLoaderListener} and {@code DelegatingFilterProxy} all now support
|
||||
* constructor arguments. Even if a component (e.g. non-Spring, other third party) has not
|
||||
* constructor arguments. Even if a component (for example, non-Spring, other third party) has not
|
||||
* been specifically updated for use within {@code WebApplicationInitializers}, they still
|
||||
* may be used in any case. The {@code ServletContext} API allows for setting init-params,
|
||||
* context-params, etc programmatically.
|
||||
|
||||
@@ -35,13 +35,13 @@ import org.springframework.web.context.request.NativeWebRequest;
|
||||
* Base class for {@code ContentNegotiationStrategy} implementations with the
|
||||
* steps to resolve a request to media types.
|
||||
*
|
||||
* <p>First a key (e.g. "json", "pdf") must be extracted from the request (e.g.
|
||||
* <p>First a key (for example, "json", "pdf") must be extracted from the request (for example,
|
||||
* file extension, query param). The key must then be resolved to media type(s)
|
||||
* through the base class {@link MappingMediaTypeFileExtensionResolver} which
|
||||
* stores such mappings.
|
||||
*
|
||||
* <p>The method {@link #handleNoMatch} allow subclasses to plug in additional
|
||||
* ways of looking up media types (e.g. through the Java Activation framework,
|
||||
* ways of looking up media types (for example, through the Java Activation framework,
|
||||
* or {@link jakarta.servlet.ServletContext#getMimeType}). Media types resolved
|
||||
* via base classes are then added to the base class
|
||||
* {@link MappingMediaTypeFileExtensionResolver}, i.e. cached for new lookups.
|
||||
@@ -69,7 +69,7 @@ public abstract class AbstractMappingContentNegotiationStrategy extends MappingM
|
||||
|
||||
/**
|
||||
* Whether to only use the registered mappings to look up file extensions,
|
||||
* or also to use dynamic resolution (e.g. via {@link MediaTypeFactory}).
|
||||
* or also to use dynamic resolution (for example, via {@link MediaTypeFactory}).
|
||||
* <p>By default this is set to {@code false}.
|
||||
*/
|
||||
public void setUseRegisteredExtensionsOnly(boolean useRegisteredExtensionsOnly) {
|
||||
|
||||
@@ -188,7 +188,7 @@ public class ContentNegotiationManagerFactoryBean
|
||||
* <p><strong>Note:</strong> Mappings registered here may be accessed via
|
||||
* {@link ContentNegotiationManager#getMediaTypeMappings()} and may be used
|
||||
* not only in the parameter and path extension strategies. For example,
|
||||
* with the Spring MVC config, e.g. {@code @EnableWebMvc} or
|
||||
* with the Spring MVC config, for example, {@code @EnableWebMvc} or
|
||||
* {@code <mvc:annotation-driven>}, the media type mappings are also plugged
|
||||
* in to:
|
||||
* <ul>
|
||||
@@ -254,7 +254,7 @@ public class ContentNegotiationManagerFactoryBean
|
||||
* When {@link #setFavorPathExtension favorPathExtension} or
|
||||
* {@link #setFavorParameter(boolean)} is set, this property determines
|
||||
* whether to use only registered {@code MediaType} mappings or to allow
|
||||
* dynamic resolution, e.g. via {@link MediaTypeFactory}.
|
||||
* dynamic resolution, for example, via {@link MediaTypeFactory}.
|
||||
* <p>By default this is not set in which case dynamic resolution is on.
|
||||
*/
|
||||
public void setUseRegisteredExtensionsOnly(boolean useRegisteredExtensionsOnly) {
|
||||
|
||||
@@ -64,7 +64,7 @@ public class MissingRequestValueException extends ServletRequestBindingException
|
||||
|
||||
|
||||
/**
|
||||
* Whether the request value was present but converted to {@code null}, e.g. via
|
||||
* Whether the request value was present but converted to {@code null}, for example, via
|
||||
* {@code org.springframework.core.convert.support.IdToEntityConverter}.
|
||||
*/
|
||||
public boolean isMissingAfterConversion() {
|
||||
|
||||
@@ -71,7 +71,7 @@ public class ServletRequestParameterPropertyValues extends MutablePropertyValues
|
||||
* @param request the HTTP request
|
||||
* @param prefix the prefix for parameters (the full prefix will
|
||||
* consist of this plus the separator)
|
||||
* @param prefixSeparator separator delimiting prefix (e.g. "spring")
|
||||
* @param prefixSeparator separator delimiting prefix (for example, "spring")
|
||||
* and the rest of the parameter name ("param1", "param2")
|
||||
*/
|
||||
public ServletRequestParameterPropertyValues(
|
||||
|
||||
@@ -66,7 +66,7 @@ public class WebDataBinder extends DataBinder {
|
||||
|
||||
/**
|
||||
* Default prefix that field marker parameters start with, followed by the field
|
||||
* name: e.g. "_subscribeToNewsletter" for a field "subscribeToNewsletter".
|
||||
* name: for example, "_subscribeToNewsletter" for a field "subscribeToNewsletter".
|
||||
* <p>Such a marker parameter indicates that the field was visible, that is,
|
||||
* existed in the form that caused the submission. If no corresponding field
|
||||
* value parameter was found, the field will be reset. The value of the field
|
||||
@@ -78,7 +78,7 @@ public class WebDataBinder extends DataBinder {
|
||||
|
||||
/**
|
||||
* Default prefix that field default parameters start with, followed by the field
|
||||
* name: e.g. "!subscribeToNewsletter" for a field "subscribeToNewsletter".
|
||||
* name: for example, "!subscribeToNewsletter" for a field "subscribeToNewsletter".
|
||||
* <p>Default parameters differ from field markers in that they provide a default
|
||||
* value instead of an empty value.
|
||||
* @see #setFieldDefaultPrefix
|
||||
@@ -120,7 +120,7 @@ public class WebDataBinder extends DataBinder {
|
||||
* empty fields, having "prefix + field" as name. Such a marker parameter is
|
||||
* checked by existence: You can send any value for it, for example "visible".
|
||||
* This is particularly useful for HTML checkboxes and select options.
|
||||
* <p>Default is "_", for "_FIELD" parameters (e.g. "_subscribeToNewsletter").
|
||||
* <p>Default is "_", for "_FIELD" parameters (for example, "_subscribeToNewsletter").
|
||||
* Set this to null if you want to turn off the empty field check completely.
|
||||
* <p>HTML checkboxes only send a value when they're checked, so it is not
|
||||
* possible to detect that a formerly checked box has just been unchecked,
|
||||
@@ -152,7 +152,7 @@ public class WebDataBinder extends DataBinder {
|
||||
* Specify a prefix that can be used for parameters that indicate default
|
||||
* value fields, having "prefix + field" as name. The value of the default
|
||||
* field is used when the field is not provided.
|
||||
* <p>Default is "!", for "!FIELD" parameters (e.g. "!subscribeToNewsletter").
|
||||
* <p>Default is "!", for "!FIELD" parameters (for example, "!subscribeToNewsletter").
|
||||
* Set this to null if you want to turn off the field defaults completely.
|
||||
* <p>HTML checkboxes only send a value when they're checked, so it is not
|
||||
* possible to detect that a formerly checked box has just been unchecked,
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.springframework.web.cors.CorsConfiguration;
|
||||
* {@link CorsConfiguration#applyPermitDefaultValues()}.
|
||||
*
|
||||
* <p>The rules for combining global and local configuration are generally
|
||||
* additive -- e.g. all global and all local origins. For those attributes
|
||||
* additive -- for example, all global and all local origins. For those attributes
|
||||
* where only a single value can be accepted such as {@code allowCredentials}
|
||||
* and {@code maxAge}, the local overrides the global value.
|
||||
* See {@link CorsConfiguration#combine(CorsConfiguration)} for more details.
|
||||
|
||||
@@ -40,7 +40,7 @@ import org.springframework.core.annotation.AliasFor;
|
||||
* cause within a wrapper exception. As of 5.3, any cause level is being
|
||||
* exposed, whereas previously only an immediate cause was considered.
|
||||
* <li>Request and/or response objects (typically from the Servlet API).
|
||||
* You may choose any specific request/response type, e.g.
|
||||
* You may choose any specific request/response type, for example,
|
||||
* {@link jakarta.servlet.ServletRequest} / {@link jakarta.servlet.http.HttpServletRequest}.
|
||||
* <li>Session object: typically {@link jakarta.servlet.http.HttpSession}.
|
||||
* An argument of this type will enforce the presence of a corresponding session.
|
||||
|
||||
@@ -63,7 +63,7 @@ public @interface MatrixVariable {
|
||||
|
||||
/**
|
||||
* The name of the URI path variable where the matrix variable is located,
|
||||
* if necessary for disambiguation (e.g. a matrix variable with the same
|
||||
* if necessary for disambiguation (for example, a matrix variable with the same
|
||||
* name present in more than one path segment).
|
||||
*/
|
||||
String pathVar() default ValueConstants.DEFAULT_NONE;
|
||||
|
||||
@@ -82,7 +82,7 @@ public @interface ModelAttribute {
|
||||
* <p>The default model attribute name is inferred from the declared
|
||||
* attribute type (i.e. the method parameter type or method return type),
|
||||
* based on the non-qualified class name:
|
||||
* e.g. "orderAddress" for class "mypackage.OrderAddress",
|
||||
* for example, "orderAddress" for class "mypackage.OrderAddress",
|
||||
* or "orderAddressList" for "List<mypackage.OrderAddress>".
|
||||
* @since 4.3
|
||||
*/
|
||||
|
||||
@@ -60,7 +60,7 @@ public @interface PathVariable {
|
||||
* <p>Defaults to {@code true}, leading to an exception being thrown if the path
|
||||
* variable is missing in the incoming request. Switch this to {@code false} if
|
||||
* you prefer a {@code null} or Java 8 {@code java.util.Optional} in this case.
|
||||
* e.g. on a {@code ModelAttribute} method which serves for different requests.
|
||||
* for example, on a {@code ModelAttribute} method which serves for different requests.
|
||||
* @since 4.3.3
|
||||
*/
|
||||
boolean required() default true;
|
||||
|
||||
@@ -61,7 +61,7 @@ import org.springframework.core.annotation.AliasFor;
|
||||
* mapping will be used. This also applies to composed {@code @RequestMapping}
|
||||
* annotations such as {@code @GetMapping}, {@code @PostMapping}, etc.
|
||||
*
|
||||
* <p><b>NOTE:</b> When using controller interfaces (e.g. for AOP proxying),
|
||||
* <p><b>NOTE:</b> When using controller interfaces (for example, for AOP proxying),
|
||||
* make sure to consistently put <i>all</i> your mapping annotations — such
|
||||
* as {@code @RequestMapping} and {@code @SessionAttributes} — on
|
||||
* the controller <i>interface</i> rather than on the implementation class.
|
||||
@@ -105,10 +105,10 @@ public @interface RequestMapping {
|
||||
|
||||
/**
|
||||
* The path mapping URIs — for example, {@code "/profile"}.
|
||||
* <p>Ant-style path patterns are also supported (e.g. {@code "/profile/**"}).
|
||||
* At the method level, relative paths (e.g. {@code "edit"}) are supported
|
||||
* <p>Ant-style path patterns are also supported (for example, {@code "/profile/**"}).
|
||||
* At the method level, relative paths (for example, {@code "edit"}) are supported
|
||||
* within the primary mapping expressed at the type level.
|
||||
* Path mapping URIs may contain placeholders (e.g. <code>"/${profile_path}"</code>).
|
||||
* Path mapping URIs may contain placeholders (for example, <code>"/${profile_path}"</code>).
|
||||
* <p><b>Supported at the type level as well as at the method level!</b>
|
||||
* When used at the type level, all method-level mappings inherit
|
||||
* this primary mapping, narrowing it for a specific handler method.
|
||||
@@ -202,7 +202,7 @@ public @interface RequestMapping {
|
||||
* produces = MediaType.TEXT_PLAIN_VALUE
|
||||
* produces = "text/plain;charset=UTF-8"
|
||||
* </pre>
|
||||
* <p>If a declared media type contains a parameter (e.g. "charset=UTF-8",
|
||||
* <p>If a declared media type contains a parameter (for example, "charset=UTF-8",
|
||||
* "type=feed", "type=entry") and if a compatible media type from the request
|
||||
* has that parameter too, then the parameter values must match. Otherwise,
|
||||
* if the media type from the request does not contain the parameter, it is
|
||||
|
||||
@@ -50,7 +50,7 @@ import org.springframework.web.multipart.MultipartResolver;
|
||||
* taking into consideration the 'Content-Type' header of the request part.
|
||||
* {@link RequestParam} is likely to be used with name-value form fields while
|
||||
* {@link RequestPart} is likely to be used with parts containing more complex content
|
||||
* e.g. JSON, XML).
|
||||
* for example, JSON, XML).
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Arjen Poutsma
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.springframework.core.annotation.AliasFor;
|
||||
* Annotation to bind a method parameter to a session attribute.
|
||||
*
|
||||
* <p>The main motivation is to provide convenient access to existing, permanent
|
||||
* session attributes (e.g. user authentication object) with an optional/required
|
||||
* session attributes (for example, user authentication object) with an optional/required
|
||||
* check and a cast to the target method parameter type.
|
||||
*
|
||||
* <p>For use cases that require adding or removing session attributes consider
|
||||
|
||||
@@ -41,12 +41,12 @@ import org.springframework.core.annotation.AliasFor;
|
||||
* to be stored in the session <i>temporarily</i> during the course of a
|
||||
* specific handler's conversation.
|
||||
*
|
||||
* <p>For permanent session attributes, e.g. a user authentication object,
|
||||
* <p>For permanent session attributes, for example, a user authentication object,
|
||||
* use the traditional {@code session.setAttribute} method instead.
|
||||
* Alternatively, consider using the attribute management capabilities of the
|
||||
* generic {@link org.springframework.web.context.request.WebRequest} interface.
|
||||
*
|
||||
* <p><b>NOTE:</b> When using controller interfaces (e.g. for AOP proxying),
|
||||
* <p><b>NOTE:</b> When using controller interfaces (for example, for AOP proxying),
|
||||
* make sure to consistently put <i>all</i> your mapping annotations —
|
||||
* such as {@code @RequestMapping} and {@code @SessionAttributes} — on
|
||||
* the controller <i>interface</i> rather than on the implementation class.
|
||||
|
||||
@@ -129,7 +129,7 @@ public class DefaultDataBinderFactory implements WebDataBinderFactory {
|
||||
|
||||
/**
|
||||
* Extension point to further initialize the created data binder instance
|
||||
* (e.g. with {@code @InitBinder} methods) after "global" initialization
|
||||
* (for example, with {@code @InitBinder} methods) after "global" initialization
|
||||
* via {@link WebBindingInitializer}.
|
||||
* @param dataBinder the data binder instance to customize
|
||||
* @param webRequest the current request
|
||||
|
||||
@@ -19,7 +19,7 @@ package org.springframework.web.bind.support;
|
||||
/**
|
||||
* Simple interface that can be injected into handler methods, allowing them to
|
||||
* signal that their session processing is complete. The handler invoker may
|
||||
* then follow up with appropriate cleanup, e.g. of session attributes which
|
||||
* then follow up with appropriate cleanup, for example, of session attributes which
|
||||
* have been implicitly created during this handler's processing (according to
|
||||
* the
|
||||
* {@link org.springframework.web.bind.annotation.SessionAttributes @SessionAttributes}
|
||||
|
||||
@@ -30,7 +30,7 @@ import org.springframework.web.context.WebApplicationContext;
|
||||
* <p>In contrast to
|
||||
* {@link org.springframework.validation.beanvalidation.SpringConstraintValidatorFactory},
|
||||
* this variant is meant for declarative use in a standard {@code validation.xml} file,
|
||||
* e.g. in combination with JAX-RS or JAX-WS.
|
||||
* for example, in combination with JAX-RS or JAX-WS.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 4.2.1
|
||||
|
||||
@@ -55,7 +55,7 @@ import org.springframework.web.multipart.support.StandardServletPartUtils;
|
||||
*
|
||||
* <p>Can also used for manual data binding in custom web controllers or interceptors
|
||||
* that build on Spring's {@link org.springframework.web.context.request.WebRequest}
|
||||
* abstraction: e.g. in a {@link org.springframework.web.context.request.WebRequestInterceptor}
|
||||
* abstraction: for example, in a {@link org.springframework.web.context.request.WebRequestInterceptor}
|
||||
* implementation. Simply instantiate a WebRequestDataBinder for each binding
|
||||
* process, and invoke {@code bind} with the current WebRequest as argument:
|
||||
*
|
||||
|
||||
@@ -384,7 +384,7 @@ public interface RestClient {
|
||||
/**
|
||||
* Configure the {@link ClientHttpRequestFactory} to use. This is useful
|
||||
* for plugging in and/or customizing options of the underlying HTTP
|
||||
* client library (e.g. SSL).
|
||||
* client library (for example, SSL).
|
||||
* <p>If no request factory is specified, {@code RestClient} uses
|
||||
* {@linkplain org.springframework.http.client.HttpComponentsClientHttpRequestFactory Apache Http Client},
|
||||
* {@linkplain org.springframework.http.client.JettyClientHttpRequestFactory Jetty Http Client}
|
||||
@@ -464,21 +464,21 @@ public interface RestClient {
|
||||
* Specify the URI using a fully constructed {@link URI}.
|
||||
* <p>If the given URI is absolute, it is used as given. If it is
|
||||
* a relative URI, the {@link UriBuilderFactory} configured for
|
||||
* the client (e.g. with a base URI) will be used to
|
||||
* the client (for example, with a base URI) will be used to
|
||||
* {@linkplain URI#resolve(URI) resolve} the given URI against.
|
||||
*/
|
||||
S uri(URI uri);
|
||||
|
||||
/**
|
||||
* Specify the URI for the request using a URI template and URI variables.
|
||||
* <p>If a {@link UriBuilderFactory} was configured for the client (e.g.
|
||||
* <p>If a {@link UriBuilderFactory} was configured for the client (for example,
|
||||
* with a base URI) it will be used to expand the URI template.
|
||||
*/
|
||||
S uri(String uri, Object... uriVariables);
|
||||
|
||||
/**
|
||||
* Specify the URI for the request using a URI template and URI variables.
|
||||
* <p>If a {@link UriBuilderFactory} was configured for the client (e.g.
|
||||
* <p>If a {@link UriBuilderFactory} was configured for the client (for example,
|
||||
* with a base URI) it will be used to expand the URI template.
|
||||
*/
|
||||
S uri(String uri, Map<String, ?> uriVariables);
|
||||
|
||||
@@ -374,7 +374,7 @@ public interface RestOperations {
|
||||
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
|
||||
* add additional HTTP headers to the request.
|
||||
* <p><b>NOTE: The standard JDK HTTP library does not support HTTP PATCH.
|
||||
* You need to use e.g. the Apache HttpComponents request factory.</b>
|
||||
* You need to use, for example, the Apache HttpComponents request factory.</b>
|
||||
* @param url the URL
|
||||
* @param request the object to be PATCHed (may be {@code null})
|
||||
* @param responseType the type of the return value
|
||||
@@ -396,7 +396,7 @@ public interface RestOperations {
|
||||
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
|
||||
* add additional HTTP headers to the request.
|
||||
* <p><b>NOTE: The standard JDK HTTP library does not support HTTP PATCH.
|
||||
* You need to use e.g. the Apache HttpComponents request factory.</b>
|
||||
* You need to use, for example, the Apache HttpComponents request factory.</b>
|
||||
* @param url the URL
|
||||
* @param request the object to be PATCHed (may be {@code null})
|
||||
* @param responseType the type of the return value
|
||||
@@ -417,7 +417,7 @@ public interface RestOperations {
|
||||
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
|
||||
* add additional HTTP headers to the request.
|
||||
* <p><b>NOTE: The standard JDK HTTP library does not support HTTP PATCH.
|
||||
* You need to use e.g. the Apache HttpComponents request factory.</b>
|
||||
* You need to use, for example, the Apache HttpComponents request factory.</b>
|
||||
* @param url the URL
|
||||
* @param request the object to be PATCHed (may be {@code null})
|
||||
* @param responseType the type of the return value
|
||||
|
||||
@@ -54,9 +54,9 @@ import org.springframework.util.StringUtils;
|
||||
*
|
||||
* <p>Processes a {@link #CONFIG_LOCATION_PARAM "contextConfigLocation"} context-param
|
||||
* and passes its value to the context instance, parsing it into potentially multiple
|
||||
* file paths which can be separated by any number of commas and spaces, e.g.
|
||||
* file paths which can be separated by any number of commas and spaces, for example,
|
||||
* "WEB-INF/applicationContext1.xml, WEB-INF/applicationContext2.xml".
|
||||
* Ant-style path patterns are supported as well, e.g.
|
||||
* Ant-style path patterns are supported as well, for example,
|
||||
* "WEB-INF/*Context.xml,WEB-INF/spring*.xml" or "WEB-INF/**/*Context.xml".
|
||||
* If not explicitly specified, the context implementation is supposed to use a
|
||||
* default location (with XmlWebApplicationContext: "/WEB-INF/applicationContext.xml").
|
||||
|
||||
@@ -22,7 +22,7 @@ package org.springframework.web.context.request;
|
||||
*
|
||||
* <p>When a handler starts asynchronous request handling, the DispatcherServlet
|
||||
* exits without invoking {@code postHandle} and {@code afterCompletion}, as it
|
||||
* normally does, since the results of request handling (e.g. ModelAndView) are
|
||||
* normally does, since the results of request handling (for example, ModelAndView) are
|
||||
* not available in the current thread and handling is not yet complete.
|
||||
* In such scenarios, the {@link #afterConcurrentHandlingStarted(WebRequest)}
|
||||
* method is invoked instead allowing implementations to perform tasks such as
|
||||
|
||||
@@ -30,9 +30,9 @@ import org.springframework.context.i18n.LocaleContextHolder;
|
||||
* <p>Alternatively, Spring's {@link org.springframework.web.filter.RequestContextFilter}
|
||||
* and Spring's {@link org.springframework.web.servlet.DispatcherServlet} also expose
|
||||
* the same request context to the current thread. In contrast to this listener,
|
||||
* advanced options are available there (e.g. "threadContextInheritable").
|
||||
* advanced options are available there (for example, "threadContextInheritable").
|
||||
*
|
||||
* <p>This listener is mainly for use with third-party servlets, e.g. the JSF FacesServlet.
|
||||
* <p>This listener is mainly for use with third-party servlets, for example, the JSF FacesServlet.
|
||||
* Within Spring's own web support, DispatcherServlet's processing is perfectly sufficient.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.springframework.web.context.request.NativeWebRequest;
|
||||
/**
|
||||
* Intercepts concurrent request handling, where the concurrent result is
|
||||
* obtained by waiting for a {@link DeferredResult} to be set from a thread
|
||||
* chosen by the application (e.g. in response to some external event).
|
||||
* chosen by the application (for example, in response to some external event).
|
||||
*
|
||||
* <p>A {@code DeferredResultProcessingInterceptor} is invoked before the start
|
||||
* of async processing, after the {@code DeferredResult} is set as well as on
|
||||
|
||||
@@ -224,7 +224,7 @@ public class StandardServletAsyncWebRequest extends ServletWebRequest implements
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Do not wait indefinitely, stop if we moved on from ASYNC state (e.g. to ERROR),
|
||||
// Do not wait indefinitely, stop if we moved on from ASYNC state (for example, to ERROR),
|
||||
// helps to avoid ABBA deadlock with onError callback
|
||||
|
||||
while (this.state == State.ASYNC) {
|
||||
|
||||
@@ -106,7 +106,7 @@ public final class WebAsyncManager {
|
||||
/**
|
||||
* Configure the {@link AsyncWebRequest} to use. This property may be set
|
||||
* more than once during a single request to accurately reflect the current
|
||||
* state of the request (e.g. following a forward, request/response
|
||||
* state of the request (for example, following a forward, request/response
|
||||
* wrapping, etc). However, it should not be set while concurrent handling
|
||||
* is in progress, i.e. while {@link #isConcurrentHandlingStarted()} is
|
||||
* {@code true}.
|
||||
|
||||
@@ -49,7 +49,7 @@ import org.springframework.web.context.ServletContextAware;
|
||||
* by the {@link #getConfigLocations} method.
|
||||
*
|
||||
* <p>Interprets resource paths as servlet context resources, i.e. as paths beneath
|
||||
* the web application root. Absolute paths, e.g. for files outside the web app root,
|
||||
* the web application root. Absolute paths, for example, for files outside the web app root,
|
||||
* can be accessed via "file:" URLs, as implemented by
|
||||
* {@link org.springframework.core.io.DefaultResourceLoader}.
|
||||
*
|
||||
|
||||
@@ -156,7 +156,7 @@ public class AnnotationConfigWebApplicationContext extends AbstractRefreshableWe
|
||||
* <p>Note that {@link #refresh()} must be called in order for the context
|
||||
* to fully process the new classes.
|
||||
* @param componentClasses one or more component classes,
|
||||
* e.g. {@link org.springframework.context.annotation.Configuration @Configuration} classes
|
||||
* for example, {@link org.springframework.context.annotation.Configuration @Configuration} classes
|
||||
* @see #scan(String...)
|
||||
* @see #loadBeanDefinitions(DefaultListableBeanFactory)
|
||||
* @see #setConfigLocation(String)
|
||||
|
||||
@@ -112,7 +112,7 @@ public class ServletContextResource extends AbstractFileResolvingResource implem
|
||||
|
||||
/**
|
||||
* This implementation delegates to {@code ServletContext.getResourceAsStream},
|
||||
* which returns {@code null} in case of a non-readable resource (e.g. a directory).
|
||||
* which returns {@code null} in case of a non-readable resource (for example, a directory).
|
||||
* @see jakarta.servlet.ServletContext#getResourceAsStream(String)
|
||||
*/
|
||||
@Override
|
||||
|
||||
@@ -42,7 +42,7 @@ import org.springframework.web.context.ServletContextAware;
|
||||
* despite not actually supporting external configuration files.
|
||||
*
|
||||
* <p>Interprets resource paths as servlet context resources, i.e. as paths beneath
|
||||
* the web application root. Absolute paths, e.g. for files outside the web app root,
|
||||
* the web application root. Absolute paths, for example, for files outside the web app root,
|
||||
* can be accessed via "file:" URLs, as implemented by
|
||||
* {@link org.springframework.core.io.DefaultResourceLoader}.
|
||||
*
|
||||
|
||||
@@ -97,7 +97,7 @@ public class XmlWebApplicationContext extends AbstractRefreshableWebApplicationC
|
||||
/**
|
||||
* Initialize the bean definition reader used for loading the bean
|
||||
* definitions of this context. Default implementation is empty.
|
||||
* <p>Can be overridden in subclasses, e.g. for turning off XML validation
|
||||
* <p>Can be overridden in subclasses, for example, for turning off XML validation
|
||||
* or using a different XmlBeanDefinitionParser implementation.
|
||||
* @param beanDefinitionReader the bean definition reader used by this context
|
||||
* @see org.springframework.beans.factory.xml.XmlBeanDefinitionReader#setValidationMode
|
||||
|
||||
@@ -125,10 +125,10 @@ public class CorsConfiguration {
|
||||
* A list of origins for which cross-origin requests are allowed where each
|
||||
* value may be one of the following:
|
||||
* <ul>
|
||||
* <li>a specific domain, e.g. {@code "https://domain1.com"}
|
||||
* <li>comma-delimited list of specific domains, e.g.
|
||||
* <li>a specific domain, for example, {@code "https://domain1.com"}
|
||||
* <li>comma-delimited list of specific domains, for example,
|
||||
* {@code "https://a1.com,https://a2.com"}; this is convenient when a value
|
||||
* is resolved through a property placeholder, e.g. {@code "${origin}"};
|
||||
* is resolved through a property placeholder, for example, {@code "${origin}"};
|
||||
* note that such placeholders must be resolved externally.
|
||||
* <li>the CORS defined special value {@code "*"} for all origins
|
||||
* </ul>
|
||||
@@ -141,7 +141,7 @@ public class CorsConfiguration {
|
||||
* As a consequence, those combinations are rejected in favor of using
|
||||
* {@link #setAllowedOriginPatterns allowedOriginPatterns} instead.
|
||||
* <p>By default this is not set which means that no origins are allowed.
|
||||
* However, an instance of this class is often initialized further, e.g. for
|
||||
* However, an instance of this class is often initialized further, for example, for
|
||||
* {@code @CrossOrigin}, via {@link #applyPermitDefaultValues()}.
|
||||
*/
|
||||
public void setAllowedOrigins(@Nullable List<String> origins) {
|
||||
@@ -198,9 +198,9 @@ public class CorsConfiguration {
|
||||
* domain1.com on port 8080 or port 8081
|
||||
* <li>{@literal https://*.domain1.com:[*]} -- domains ending with
|
||||
* domain1.com on any port, including the default port
|
||||
* <li>comma-delimited list of patters, e.g.
|
||||
* <li>comma-delimited list of patters, for example,
|
||||
* {@code "https://*.a1.com,https://*.a2.com"}; this is convenient when a
|
||||
* value is resolved through a property placeholder, e.g. {@code "${origin}"};
|
||||
* value is resolved through a property placeholder, for example, {@code "${origin}"};
|
||||
* note that such placeholders must be resolved externally.
|
||||
* </ul>
|
||||
* <p>In contrast to {@link #setAllowedOrigins(List) allowedOrigins} which
|
||||
@@ -289,7 +289,7 @@ public class CorsConfiguration {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the HTTP methods to allow, e.g. {@code "GET"}, {@code "POST"},
|
||||
* Set the HTTP methods to allow, for example, {@code "GET"}, {@code "POST"},
|
||||
* {@code "PUT"}, etc. The special value {@code "*"} allows all methods.
|
||||
* <p>{@code Access-Control-Allow-Methods} response header is set either
|
||||
* to the configured method or to {@code "*"}. Keep in mind however that the
|
||||
@@ -783,7 +783,7 @@ public class CorsConfiguration {
|
||||
|
||||
|
||||
/**
|
||||
* Contains both the user-declared pattern (e.g. "https://*.domain.com") and
|
||||
* Contains both the user-declared pattern (for example, "https://*.domain.com") and
|
||||
* the regex {@link Pattern} derived from it.
|
||||
*/
|
||||
private static class OriginPattern {
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
/**
|
||||
* {@link jakarta.servlet.Filter} to handle CORS pre-flight requests and intercept
|
||||
* CORS simple and actual requests with a {@link CorsProcessor}, and to update
|
||||
* the response, e.g. with CORS response headers, based on the policy matched
|
||||
* the response, for example, with CORS response headers, based on the policy matched
|
||||
* through the provided {@link CorsConfigurationSource}.
|
||||
*
|
||||
* <p>This is an alternative to configuring CORS in the Spring MVC Java config
|
||||
|
||||
@@ -353,7 +353,7 @@ public class ForwardedHeaderFilter extends OncePerRequestFilter {
|
||||
/**
|
||||
* Responsible for the contextPath, requestURI, and requestURL with forwarded
|
||||
* headers in mind, and also taking into account changes to the path of the
|
||||
* underlying delegate request (e.g. on a Servlet FORWARD).
|
||||
* underlying delegate request (for example, on a Servlet FORWARD).
|
||||
*/
|
||||
private static class ForwardedPrefixExtractor {
|
||||
|
||||
@@ -375,7 +375,7 @@ public class ForwardedHeaderFilter extends OncePerRequestFilter {
|
||||
* Constructor with required information.
|
||||
* @param delegate supplier for the current
|
||||
* {@link HttpServletRequestWrapper#getRequest() delegate request} which
|
||||
* may change during a forward (e.g. Tomcat.
|
||||
* may change during a forward (for example, Tomcat.
|
||||
* @param baseUrl the host, scheme, and port based on forwarded headers
|
||||
*/
|
||||
public ForwardedPrefixExtractor(Supplier<HttpServletRequest> delegate, String baseUrl) {
|
||||
@@ -446,7 +446,7 @@ public class ForwardedHeaderFilter extends OncePerRequestFilter {
|
||||
}
|
||||
|
||||
private void recalculatePathsIfNecessary() {
|
||||
// Path of delegate request changed, e.g. FORWARD on Tomcat
|
||||
// Path of delegate request changed, for example, FORWARD on Tomcat
|
||||
if (!this.actualRequestUri.equals(this.delegate.get().getRequestURI())) {
|
||||
this.actualRequestUri = this.delegate.get().getRequestURI();
|
||||
// Keep call order
|
||||
|
||||
@@ -188,7 +188,7 @@ public abstract class OncePerRequestFilter extends GenericFilterBean {
|
||||
/**
|
||||
* The dispatcher type {@code jakarta.servlet.DispatcherType.ASYNC} means a
|
||||
* filter can be invoked in more than one thread over the course of a single
|
||||
* request. Some filters only need to filter the initial thread (e.g. request
|
||||
* request. Some filters only need to filter the initial thread (for example, request
|
||||
* wrapping) while others may need to be invoked at least once in each
|
||||
* additional thread for example for setting up thread locals or to perform
|
||||
* final processing at the very end.
|
||||
@@ -232,7 +232,7 @@ public abstract class OncePerRequestFilter extends GenericFilterBean {
|
||||
/**
|
||||
* Typically an ERROR dispatch happens after the REQUEST dispatch completes,
|
||||
* and the filter chain starts anew. On some servers however the ERROR
|
||||
* dispatch may be nested within the REQUEST dispatch, e.g. as a result of
|
||||
* dispatch may be nested within the REQUEST dispatch, for example, as a result of
|
||||
* calling {@code sendError} on the response. In that case we are still in
|
||||
* the filter chain, on the same thread, but the request and response have
|
||||
* been switched to the original, unwrapped ones.
|
||||
|
||||
@@ -36,7 +36,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
* and Spring's {@link org.springframework.web.servlet.DispatcherServlet} also expose
|
||||
* the same request context to the current thread.
|
||||
*
|
||||
* <p>This filter is mainly for use with third-party servlets, e.g. the JSF FacesServlet.
|
||||
* <p>This filter is mainly for use with third-party servlets, for example, the JSF FacesServlet.
|
||||
* Within Spring's own web support, DispatcherServlet's processing is perfectly sufficient.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
@@ -62,7 +62,7 @@ public class RequestContextFilter extends OncePerRequestFilter {
|
||||
* (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) {
|
||||
|
||||
@@ -43,7 +43,7 @@ import org.springframework.web.util.WebUtils;
|
||||
* not sent, but rather a {@code 304 "Not Modified"} status instead.
|
||||
*
|
||||
* <p>Since the ETag is based on the response content, the response
|
||||
* (e.g. a {@link org.springframework.web.servlet.View}) is still rendered.
|
||||
* (for example, a {@link org.springframework.web.servlet.View}) is still rendered.
|
||||
* As such, this filter only saves bandwidth, not server performance.
|
||||
*
|
||||
* <p>State-changing HTTP methods and other HTTP conditional request headers such as
|
||||
|
||||
@@ -118,7 +118,7 @@ public final class UrlHandlerFilter extends OncePerRequestFilter {
|
||||
|
||||
/**
|
||||
* Create a builder by adding a handler for URL's with a trailing slash.
|
||||
* @param pathPatterns path patterns to map the handler to, e.g.
|
||||
* @param pathPatterns path patterns to map the handler to, for example,
|
||||
* <code>"/path/*"</code>, <code>"/path/**"</code>,
|
||||
* <code>"/path/foo/"</code>.
|
||||
* @return a spec to configure the trailing slash handler with
|
||||
@@ -136,7 +136,7 @@ public final class UrlHandlerFilter extends OncePerRequestFilter {
|
||||
|
||||
/**
|
||||
* Add a handler for URL's with a trailing slash.
|
||||
* @param pathPatterns path patterns to map the handler to, e.g.
|
||||
* @param pathPatterns path patterns to map the handler to, for example,
|
||||
* <code>"/path/*"</code>, <code>"/path/**"</code>,
|
||||
* <code>"/path/foo/"</code>.
|
||||
* @return a spec to configure the handler with
|
||||
|
||||
@@ -188,7 +188,7 @@ public class ControllerAdviceBean implements Ordered {
|
||||
public Object resolveBean() {
|
||||
if (this.resolvedBean == null) {
|
||||
Object resolvedBean = this.beanFactory.getBean(this.beanName);
|
||||
// Don't cache non-singletons (e.g., prototypes).
|
||||
// Don't cache non-singletons (for example, prototypes).
|
||||
if (!this.isSingleton) {
|
||||
return resolvedBean;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
* method annotations, etc.
|
||||
*
|
||||
* <p>The class may be created with a bean instance or with a bean name
|
||||
* (e.g. lazy-init bean, prototype bean). Use {@link #createWithResolvedBean()}
|
||||
* (for example, lazy-init bean, prototype bean). Use {@link #createWithResolvedBean()}
|
||||
* to obtain a {@code HandlerMethod} instance with a bean instance resolved
|
||||
* through the associated {@link BeanFactory}.
|
||||
*
|
||||
@@ -372,7 +372,7 @@ public class HandlerMethod extends AnnotatedMethod {
|
||||
String text = "The mapped handler method class '" + methodDeclaringClass.getName() +
|
||||
"' is not an instance of the actual controller bean class '" +
|
||||
targetBeanClass.getName() + "'. If the controller requires proxying " +
|
||||
"(e.g. due to @Transactional), please use class-based proxying.";
|
||||
"(for example, due to @Transactional), please use class-based proxying.";
|
||||
throw new IllegalStateException(formatInvokeError(text, args));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ public final class HandlerTypePredicate implements Predicate<Class<?>> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Match handlers declared under a base package, e.g. "org.example".
|
||||
* Match handlers declared under a base package, for example, "org.example".
|
||||
* @param packages one or more base package names
|
||||
*/
|
||||
public static HandlerTypePredicate forBasePackage(String... packages) {
|
||||
@@ -163,7 +163,7 @@ public final class HandlerTypePredicate implements Predicate<Class<?>> {
|
||||
private final List<Class<? extends Annotation>> annotations = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Match handlers declared under a base package, e.g. "org.example".
|
||||
* Match handlers declared under a base package, for example, "org.example".
|
||||
* @param packages one or more base package classes
|
||||
*/
|
||||
public Builder basePackage(String... packages) {
|
||||
|
||||
@@ -202,7 +202,7 @@ public class ExceptionHandlerMethodResolver {
|
||||
|
||||
/**
|
||||
* Find a {@link Method} to handle the given exception type. This can be
|
||||
* useful if an {@link Exception} instance is not available (e.g. for tools).
|
||||
* useful if an {@link Exception} instance is not available (for example, for tools).
|
||||
* <p>Uses {@link ExceptionDepthComparator} if more than one match is found.
|
||||
* @param exceptionType the exception type
|
||||
* @return a Method to handle the exception, or {@code null} if none found
|
||||
@@ -215,7 +215,7 @@ public class ExceptionHandlerMethodResolver {
|
||||
|
||||
/**
|
||||
* Find a {@link Method} to handle the given exception type and media type.
|
||||
* This can be useful if an {@link Exception} instance is not available (e.g. for tools).
|
||||
* This can be useful if an {@link Exception} instance is not available (for example, for tools).
|
||||
* @param exceptionType the exception type
|
||||
* @param mediaType the media type requested by the HTTP client
|
||||
* @return a Method to handle the exception, or {@code null} if none found
|
||||
|
||||
@@ -124,7 +124,7 @@ public class InvocableHandlerMethod extends HandlerMethod {
|
||||
|
||||
/**
|
||||
* Set the ParameterNameDiscoverer for resolving parameter names when needed
|
||||
* (e.g. default request attribute name).
|
||||
* (for example, default request attribute name).
|
||||
* <p>Default is a {@link org.springframework.core.DefaultParameterNameDiscoverer}.
|
||||
*/
|
||||
public void setParameterNameDiscoverer(ParameterNameDiscoverer parameterNameDiscoverer) {
|
||||
|
||||
@@ -165,7 +165,7 @@ public class ModelAndViewContainer {
|
||||
* returns either the "default" model (template rendering) or the "redirect"
|
||||
* model (redirect URL preparation). Use of this method may be needed for
|
||||
* advanced cases when access to the "default" model is needed regardless,
|
||||
* e.g. to save model attributes specified via {@code @SessionAttributes}.
|
||||
* for example, to save model attributes specified via {@code @SessionAttributes}.
|
||||
* @return the default model (never {@code null})
|
||||
* @since 4.1.4
|
||||
*/
|
||||
@@ -184,7 +184,7 @@ public class ModelAndViewContainer {
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the controller has returned a redirect instruction, e.g. a
|
||||
* Whether the controller has returned a redirect instruction, for example, a
|
||||
* "redirect:" prefixed view name, a RedirectView instance, etc.
|
||||
*/
|
||||
public void setRedirectModelScenario(boolean redirectModelScenario) {
|
||||
@@ -253,7 +253,7 @@ public class ModelAndViewContainer {
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the request has been handled fully within the handler, e.g.
|
||||
* Whether the request has been handled fully within the handler, for example,
|
||||
* {@code @ResponseBody} method, and therefore view resolution is not
|
||||
* necessary. This flag can also be set when controller methods declare an
|
||||
* argument of type {@code ServletResponse} or {@code OutputStream}).
|
||||
|
||||
@@ -124,7 +124,7 @@ public interface MultipartFile extends InputStreamSource {
|
||||
* in order to work with any storage mechanism.
|
||||
* <p><b>NOTE:</b> Depending on the underlying provider, temporary storage
|
||||
* may be container-dependent, including the base directory for relative
|
||||
* destinations specified here (e.g. with Servlet multipart handling).
|
||||
* destinations specified here (for example, with Servlet multipart handling).
|
||||
* For absolute destinations, the target file may get renamed/moved from its
|
||||
* temporary location or newly copied, even if a temporary copy already exists.
|
||||
* @param dest the destination file (typically absolute)
|
||||
|
||||
@@ -62,7 +62,7 @@ public interface MultipartHttpServletRequest extends HttpServletRequest, Multipa
|
||||
/**
|
||||
* Return the headers for the specified part of the multipart request.
|
||||
* <p>If the underlying implementation supports access to part headers,
|
||||
* then all headers are returned. Otherwise, e.g. for a file upload, the
|
||||
* then all headers are returned. Otherwise, for example, for a file upload, the
|
||||
* returned headers may expose a 'Content-Type' if available.
|
||||
*/
|
||||
@Nullable
|
||||
|
||||
@@ -28,7 +28,7 @@ import org.springframework.web.multipart.MultipartResolver;
|
||||
* Signals the part of a "multipart/form-data" request, identified by name
|
||||
* could not be found. This may be because the request is not a multipart
|
||||
* request, or a part with that name is not present, or because the application
|
||||
* is not configured correctly for processing multipart requests, e.g. there
|
||||
* is not configured correctly for processing multipart requests, for example, there
|
||||
* is no {@link MultipartResolver}.
|
||||
*
|
||||
* <p><strong>Note:</strong> This exception does not extend from
|
||||
|
||||
@@ -54,7 +54,7 @@ import org.springframework.web.multipart.MultipartResolver;
|
||||
* <p>Note: This filter is an <b>alternative</b> to using DispatcherServlet's
|
||||
* MultipartResolver support, for example for web applications with custom web views
|
||||
* which do not use Spring's web MVC, or for custom filters applied before a Spring MVC
|
||||
* DispatcherServlet (e.g. {@link org.springframework.web.filter.HiddenHttpMethodFilter}).
|
||||
* DispatcherServlet (for example, {@link org.springframework.web.filter.HiddenHttpMethodFilter}).
|
||||
* In any case, this filter should not be combined with servlet-specific multipart resolution.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
|
||||
@@ -148,7 +148,7 @@ public class StandardMultipartHttpServletRequest extends AbstractMultipartHttpSe
|
||||
}
|
||||
|
||||
// Servlet getParameterNames() not guaranteed to include multipart form items
|
||||
// (e.g. on WebLogic 12) -> need to merge them here to be on the safe side
|
||||
// (for example, on WebLogic 12) -> need to merge them here to be on the safe side
|
||||
Set<String> paramNames = new LinkedHashSet<>();
|
||||
Enumeration<String> paramEnum = super.getParameterNames();
|
||||
while (paramEnum.hasMoreElements()) {
|
||||
@@ -169,7 +169,7 @@ public class StandardMultipartHttpServletRequest extends AbstractMultipartHttpSe
|
||||
}
|
||||
|
||||
// Servlet getParameterMap() not guaranteed to include multipart form items
|
||||
// (e.g. on WebLogic 12) -> need to merge them here to be on the safe side
|
||||
// (for example, on WebLogic 12) -> need to merge them here to be on the safe side
|
||||
Map<String, String[]> paramMap = new LinkedHashMap<>(super.getParameterMap());
|
||||
for (String paramName : this.multipartParameterNames) {
|
||||
if (!paramMap.containsKey(paramName)) {
|
||||
@@ -269,7 +269,7 @@ public class StandardMultipartHttpServletRequest extends AbstractMultipartHttpSe
|
||||
if (dest.isAbsolute() && !dest.exists()) {
|
||||
// Servlet Part.write is not guaranteed to support absolute file paths:
|
||||
// may translate the given path to a relative location within a temp dir
|
||||
// (e.g. on Jetty whereas Tomcat and Undertow detect absolute paths).
|
||||
// (for example, on Jetty whereas Tomcat and Undertow detect absolute paths).
|
||||
// At least we offloaded the file from memory storage; it'll get deleted
|
||||
// from the temp dir eventually in any case. And for our user's purposes,
|
||||
// we can manually copy it to the requested location as a fallback.
|
||||
|
||||
@@ -88,7 +88,7 @@ public class StandardServletMultipartResolver implements MultipartResolver {
|
||||
* specification, only kicking in for "multipart/form-data" requests.
|
||||
* <p>Default is "false", trying to process any request with a "multipart/"
|
||||
* content type as far as the underlying Servlet container supports it
|
||||
* (which works on e.g. Tomcat but not on Jetty). For consistent portability
|
||||
* (which works on, for example, Tomcat but not on Jetty). For consistent portability
|
||||
* and in particular for consistent custom handling of non-form multipart
|
||||
* request types outside of Spring's {@link MultipartResolver} mechanism,
|
||||
* switch this flag to "true": Only "multipart/form-data" requests will be
|
||||
|
||||
@@ -46,7 +46,7 @@ public class MissingRequestValueException extends ServerWebInputException {
|
||||
|
||||
|
||||
/**
|
||||
* Return the name of the missing value, e.g. the name of the missing request
|
||||
* Return the name of the missing value, for example, the name of the missing request
|
||||
* header, or cookie, etc.
|
||||
*/
|
||||
public String getName() {
|
||||
@@ -61,7 +61,7 @@ public class MissingRequestValueException extends ServerWebInputException {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a label that describes the request value, e.g. "request header",
|
||||
* Return a label that describes the request value, for example, "request header",
|
||||
* "cookie value", etc. Use this to create a custom message.
|
||||
*/
|
||||
public String getLabel() {
|
||||
|
||||
@@ -109,7 +109,7 @@ public class ResponseStatusException extends ErrorResponseException {
|
||||
}
|
||||
|
||||
/**
|
||||
* Return headers to add to the error response, e.g. "Allow", "Accept", etc.
|
||||
* Return headers to add to the error response, for example, "Allow", "Accept", etc.
|
||||
* <p>By default, delegates to {@link #getResponseHeaders()} for backwards
|
||||
* compatibility.
|
||||
*/
|
||||
@@ -120,7 +120,7 @@ public class ResponseStatusException extends ErrorResponseException {
|
||||
|
||||
/**
|
||||
* Return headers associated with the exception that should be added to the
|
||||
* error response, e.g. "Allow", "Accept", etc.
|
||||
* error response, for example, "Allow", "Accept", etc.
|
||||
* <p>The default implementation in this class returns empty headers.
|
||||
* @since 5.1.13
|
||||
* @deprecated as of 6.0 in favor of {@link #getHeaders()}
|
||||
|
||||
@@ -22,7 +22,7 @@ import org.springframework.lang.Nullable;
|
||||
|
||||
/**
|
||||
* Exception for errors that fit response status 400 (bad request) for use in
|
||||
* Spring Web applications. The exception provides additional fields (e.g.
|
||||
* Spring Web applications. The exception provides additional fields (for example,
|
||||
* an optional {@link MethodParameter} if related to the error).
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
|
||||
@@ -91,7 +91,7 @@ public class ExceptionHandlingWebHandler extends WebHandlerDecorator {
|
||||
/**
|
||||
* WebExceptionHandler to insert a checkpoint with current URL information.
|
||||
* Must be the first in order to ensure we catch the error signal before
|
||||
* the exception is handled and e.g. turned into an error response.
|
||||
* the exception is handled and, for example, turned into an error response.
|
||||
* @since 5.2
|
||||
*/
|
||||
private static class CheckpointInsertingHandler implements WebExceptionHandler {
|
||||
|
||||
@@ -82,7 +82,7 @@ public class InMemoryWebSessionStore implements WebSessionStore {
|
||||
* Configure the {@link Clock} to use to set lastAccessTime on every created
|
||||
* session and to calculate if it is expired.
|
||||
* <p>This may be useful to align to different timezone or to set the clock
|
||||
* back in a test, e.g. {@code Clock.offset(clock, Duration.ofMinutes(-31))}
|
||||
* back in a test, for example, {@code Clock.offset(clock, Duration.ofMinutes(-31))}
|
||||
* in order to simulate session expiration.
|
||||
* <p>By default this is {@code Clock.system(ZoneId.of("GMT"))}.
|
||||
* @param clock the clock to use
|
||||
|
||||
@@ -109,7 +109,7 @@ import org.springframework.web.util.UriBuilderFactory;
|
||||
* <td>{@link org.springframework.web.bind.annotation.RequestPart @RequestPart}</td>
|
||||
* <td>Add a request part, which may be a String (form field),
|
||||
* {@link org.springframework.core.io.Resource} (file part), Object (entity to be
|
||||
* encoded, e.g. as JSON), {@link HttpEntity} (part content and headers), a
|
||||
* encoded, for example, as JSON), {@link HttpEntity} (part content and headers), a
|
||||
* {@link org.springframework.http.codec.multipart.Part}, or a
|
||||
* {@link org.reactivestreams.Publisher} of any of the above.
|
||||
* (</td>
|
||||
|
||||
@@ -246,7 +246,7 @@ public abstract class AbstractNamedValueArgumentResolver implements HttpServiceA
|
||||
* @param name the name to use, possibly empty if not specified
|
||||
* @param required whether it is marked as required
|
||||
* @param defaultValue fallback value, possibly {@link ValueConstants#DEFAULT_NONE}
|
||||
* @param label how it should appear in error messages, e.g. "path variable", "request header"
|
||||
* @param label how it should appear in error messages, for example, "path variable", "request header"
|
||||
* @param multiValued whether this argument resolver supports sending multiple values;
|
||||
* if not, then multiple values are formatted as a String value
|
||||
*/
|
||||
|
||||
@@ -360,7 +360,7 @@ public class HttpRequestValues {
|
||||
* <ul>
|
||||
* <li>String -- form field
|
||||
* <li>{@link org.springframework.core.io.Resource Resource} -- file part
|
||||
* <li>Object -- content to be encoded (e.g. to JSON)
|
||||
* <li>Object -- content to be encoded (for example, to JSON)
|
||||
* <li>{@link HttpEntity} -- part content and headers although generally it's
|
||||
* easier to add headers through the returned builder
|
||||
* </ul>
|
||||
|
||||
@@ -64,7 +64,7 @@ public class RequestParamArgumentResolver extends AbstractNamedValueArgumentReso
|
||||
|
||||
|
||||
/**
|
||||
* Whether to format multiple values (e.g. collection, array) as a single
|
||||
* Whether to format multiple values (for example, collection, array) as a single
|
||||
* String value through the configured {@link ConversionService} unless the
|
||||
* content type is form data, or it is a multipart request.
|
||||
* <p>By default, this is {@code false} in which case formatting is not applied,
|
||||
|
||||
@@ -40,7 +40,7 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
* <li>String -- form field
|
||||
* <li>{@link org.springframework.core.io.Resource Resource} -- file part
|
||||
* <li>{@link MultipartFile} -- uploaded file
|
||||
* <li>Object -- content to be encoded (e.g. to JSON)
|
||||
* <li>Object -- content to be encoded (for example, to JSON)
|
||||
* <li>{@link HttpEntity} -- part content and headers although generally it's
|
||||
* easier to add headers through the returned builder
|
||||
* <li>{@link Part} -- a part from a server request
|
||||
|
||||
@@ -47,7 +47,7 @@ import org.springframework.util.FastByteArrayOutputStream;
|
||||
* content is not consumed, then the content is not cached, and cannot be
|
||||
* retrieved via {@link #getContentAsByteArray()}.
|
||||
*
|
||||
* <p>Used e.g. by {@link org.springframework.web.filter.AbstractRequestLoggingFilter}.
|
||||
* <p>Used, for example, by {@link org.springframework.web.filter.AbstractRequestLoggingFilter}.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @author Brian Clozel
|
||||
|
||||
@@ -40,7 +40,7 @@ import org.springframework.util.FastByteArrayOutputStream;
|
||||
* the {@linkplain #getOutputStream() output stream} and {@linkplain #getWriter() writer},
|
||||
* and allows this content to be retrieved via a {@linkplain #getContentAsByteArray() byte array}.
|
||||
*
|
||||
* <p>Used e.g. by {@link org.springframework.web.filter.ShallowEtagHeaderFilter}.
|
||||
* <p>Used, for example, by {@link org.springframework.web.filter.ShallowEtagHeaderFilter}.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @author Sam Brannen
|
||||
|
||||
@@ -822,7 +822,7 @@ final class HierarchicalUriComponents extends UriComponents {
|
||||
* Whether the given String is a single URI variable that can be
|
||||
* expanded. It must have '{' and '}' surrounding non-empty text and no
|
||||
* nested placeholders unless it is a variable with regex syntax,
|
||||
* e.g. {@code "/{year:\d{1,4}}"}.
|
||||
* for example, {@code "/{year:\d{1,4}}"}.
|
||||
*/
|
||||
private boolean isUriVariable(CharSequence source) {
|
||||
if (source.length() < 2 || source.charAt(0) != '{' || source.charAt(source.length() -1) != '}') {
|
||||
|
||||
@@ -51,7 +51,7 @@ public abstract class HtmlUtils {
|
||||
* Turn special characters into HTML character references.
|
||||
* <p>Handles the complete character set defined in the HTML 4.01 recommendation.
|
||||
* <p>Escapes all special characters to their corresponding
|
||||
* entity reference (e.g. {@code <}).
|
||||
* entity reference (for example, {@code <}).
|
||||
* <p>Reference:
|
||||
* <a href="https://www.w3.org/TR/html4/sgml/entities.html">
|
||||
* https://www.w3.org/TR/html4/sgml/entities.html
|
||||
@@ -67,7 +67,7 @@ public abstract class HtmlUtils {
|
||||
* Turn special characters into HTML character references.
|
||||
* <p>Handles the complete character set defined in the HTML 4.01 recommendation.
|
||||
* <p>Escapes all special characters to their corresponding
|
||||
* entity reference (e.g. {@code <}) at least as required by the
|
||||
* entity reference (for example, {@code <}) at least as required by the
|
||||
* specified encoding. In other words, if a special character does
|
||||
* not have to be escaped for the given encoding, it may not be.
|
||||
* <p>Reference:
|
||||
|
||||
@@ -52,7 +52,7 @@ import org.springframework.beans.CachedIntrospectionResults;
|
||||
* <p>Application classes hardly ever need to use the JavaBeans Introspector
|
||||
* directly, so are normally not the cause of Introspector resource leaks.
|
||||
* Rather, many libraries and frameworks do not clean up the Introspector:
|
||||
* e.g. Struts and Quartz.
|
||||
* for example, Struts and Quartz.
|
||||
*
|
||||
* <p>Note that a single such Introspector leak will cause the entire web
|
||||
* app class loader to not get garbage collected! This has the consequence that
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.util.SystemPropertyUtils;
|
||||
* Helper class for resolving placeholders in texts. Usually applied to file paths.
|
||||
*
|
||||
* <p>A text may contain {@code ${...}} placeholders, to be resolved as servlet context
|
||||
* init parameters or system properties: e.g. {@code ${user.dir}}. Default values can
|
||||
* init parameters or system properties: for example, {@code ${user.dir}}. Default values can
|
||||
* be supplied using the ":" separator between key and value.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
|
||||
@@ -166,7 +166,7 @@ public interface UriBuilder {
|
||||
* Append the given query parameter. Both the parameter name and values may
|
||||
* contain URI template variables to be expanded later from values. If no
|
||||
* values are given, the resulting URI will contain the query parameter name
|
||||
* only, e.g. {@code "?foo"} instead of {@code "?foo=bar"}.
|
||||
* only, for example, {@code "?foo"} instead of {@code "?foo=bar"}.
|
||||
* <p><strong>Note:</strong> encoding, if applied, will only encode characters
|
||||
* that are illegal in a query parameter name or value such as {@code "="}
|
||||
* or {@code "&"}. All others that are legal as per syntax rules in
|
||||
|
||||
@@ -38,7 +38,7 @@ import org.springframework.util.CollectionUtils;
|
||||
* <p><strong>Note:</strong> this class uses {@link UriComponentsBuilder}
|
||||
* internally to expand URI templates, and is merely a shortcut for already
|
||||
* prepared URI templates. For more dynamic preparation and extra flexibility,
|
||||
* e.g. around URI encoding, consider using {@code UriComponentsBuilder} or the
|
||||
* for example, around URI encoding, consider using {@code UriComponentsBuilder} or the
|
||||
* higher level {@link DefaultUriBuilderFactory} which adds several encoding
|
||||
* modes on top of {@code UriComponentsBuilder}. See the
|
||||
* <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#mvc-uri-building">reference docs</a>
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.springframework.util.StringUtils;
|
||||
*
|
||||
* <p>There are two types of encode methods:
|
||||
* <ul>
|
||||
* <li>{@code "encodeXyz"} -- these encode a specific URI component (e.g. path,
|
||||
* <li>{@code "encodeXyz"} -- these encode a specific URI component (for example, path,
|
||||
* query) by percent encoding illegal characters, which includes non-US-ASCII
|
||||
* characters, and also characters that are otherwise illegal within the given
|
||||
* URI component type, as defined in RFC 3986. The effect of this method, with
|
||||
@@ -389,8 +389,8 @@ public abstract class UriUtils {
|
||||
|
||||
/**
|
||||
* Extract the file extension from the given URI path.
|
||||
* @param path the URI path (e.g. "/products/index.html")
|
||||
* @return the extracted file extension (e.g. "html")
|
||||
* @param path the URI path (for example, "/products/index.html")
|
||||
* @return the extracted file extension (for example, "html")
|
||||
* @since 4.3.2
|
||||
*/
|
||||
@Nullable
|
||||
|
||||
@@ -284,11 +284,11 @@ public class UrlPathHelper {
|
||||
* i.e. the part of the request's URL beyond the part that called the servlet,
|
||||
* or "" if the whole URL has been used to identify the servlet.
|
||||
* <p>Detects include request URL if called within a RequestDispatcher include.
|
||||
* <p>E.g.: servlet mapping = "/*"; request URI = "/test/a" → "/test/a".
|
||||
* <p>E.g.: servlet mapping = "/"; request URI = "/test/a" → "/test/a".
|
||||
* <p>E.g.: servlet mapping = "/test/*"; request URI = "/test/a" → "/a".
|
||||
* <p>E.g.: servlet mapping = "/test"; request URI = "/test" → "".
|
||||
* <p>E.g.: servlet mapping = "/*.test"; request URI = "/a.test" → "".
|
||||
* <p>For example: servlet mapping = "/*"; request URI = "/test/a" → "/test/a".
|
||||
* <p>For example: servlet mapping = "/"; request URI = "/test/a" → "/test/a".
|
||||
* <p>For example: servlet mapping = "/test/*"; request URI = "/test/a" → "/a".
|
||||
* <p>For example: servlet mapping = "/test"; request URI = "/test" → "".
|
||||
* <p>For example: servlet mapping = "/*.test"; request URI = "/a.test" → "".
|
||||
* @param request current HTTP request
|
||||
* @param pathWithinApp a precomputed path within the application
|
||||
* @return the path within the servlet mapping, or ""
|
||||
@@ -317,7 +317,7 @@ public class UrlPathHelper {
|
||||
String pathInfo = request.getPathInfo();
|
||||
if (pathInfo != null) {
|
||||
// Use path info if available. Indicates index page within a servlet mapping?
|
||||
// e.g. with index page: URI="/", servletPath="/index.html"
|
||||
// for example, with index page: URI="/", servletPath="/index.html"
|
||||
return pathInfo;
|
||||
}
|
||||
if (!this.urlDecode) {
|
||||
|
||||
@@ -33,7 +33,7 @@ import jakarta.servlet.ServletContextListener;
|
||||
* at least when used for log4j. Log4jConfigListener sets the system property
|
||||
* implicitly, so there's no need for this listener in addition to it.
|
||||
*
|
||||
* <p><b>WARNING</b>: Some containers, e.g. Tomcat, do NOT keep system properties separate
|
||||
* <p><b>WARNING</b>: Some containers, for example, Tomcat, do NOT keep system properties separate
|
||||
* per web app. You have to use unique "webAppRootKey" context-params per web app
|
||||
* then, to avoid clashes. Other containers like Resin do isolate each web app's
|
||||
* system properties: Here you can use the default key (i.e. no "webAppRootKey"
|
||||
|
||||
@@ -630,7 +630,7 @@ public abstract class WebUtils {
|
||||
* <ol>
|
||||
* <li>Try to get the parameter value using just the given <i>logical</i> name.
|
||||
* This handles parameters of the form {@code logicalName = value}. For normal
|
||||
* parameters, e.g. submitted using a hidden HTML form field, this will return
|
||||
* parameters, for example, submitted using a hidden HTML form field, this will return
|
||||
* the requested value.</li>
|
||||
* <li>Try to obtain the parameter value from the parameter name, where the
|
||||
* parameter name in the request is of the form {@code logicalName_value = xyz}
|
||||
|
||||
@@ -380,7 +380,7 @@ class InternalPathPatternParser {
|
||||
/**
|
||||
* For a path element representing a captured variable, locate the constraint pattern.
|
||||
* Assumes there is a constraint pattern.
|
||||
* @param data a complete path expression, e.g. /aaa/bbb/{ccc:...}
|
||||
* @param data a complete path expression, for example, /aaa/bbb/{ccc:...}
|
||||
* @param offset the start of the capture pattern of interest
|
||||
* @return the index of the character after the ':' within
|
||||
* the pattern expression relative to the start of the whole expression
|
||||
|
||||
@@ -121,7 +121,7 @@ public class PathPatternParser {
|
||||
* stage. Produces a PathPattern object that can be used for fast matching
|
||||
* against paths. Each invocation of this method delegates to a new instance of
|
||||
* the {@link InternalPathPatternParser} because that class is not thread-safe.
|
||||
* @param pathPattern the input path pattern, e.g. /project/{name}
|
||||
* @param pathPattern the input path pattern, for example, /project/{name}
|
||||
* @return a PathPattern for quickly matching paths against request paths
|
||||
* @throws PatternParseException in case of parse errors
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user