Merge branch '5.3.x'

# Conflicts:
#	spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolver.java
This commit is contained in:
Sam Brannen 2022-07-12 10:48:51 +02:00
commit 87a2652604
50 changed files with 84 additions and 84 deletions

View File

@ -638,7 +638,7 @@ public abstract class FrameworkServlet extends HttpServletBean implements Applic
* {@link org.springframework.web.context.ConfigurableWebApplicationContext} * {@link org.springframework.web.context.ConfigurableWebApplicationContext}
* interface. Can be overridden in subclasses. * interface. Can be overridden in subclasses.
* <p>Do not forget to register this servlet instance as application listener on the * <p>Do not forget to register this servlet instance as application listener on the
* created context (for triggering its {@link #onRefresh callback}, and to call * created context (for triggering its {@link #onRefresh callback}), and to call
* {@link org.springframework.context.ConfigurableApplicationContext#refresh()} * {@link org.springframework.context.ConfigurableApplicationContext#refresh()}
* before returning the context instance. * before returning the context instance.
* @param parent the parent ApplicationContext to use, or {@code null} if none * @param parent the parent ApplicationContext to use, or {@code null} if none

View File

@ -40,7 +40,7 @@ import org.springframework.lang.Nullable;
* <p>Note: {@code HandlerAdapter} implementors may implement the {@link * <p>Note: {@code HandlerAdapter} implementors may implement the {@link
* org.springframework.core.Ordered} interface to be able to specify a sorting * org.springframework.core.Ordered} interface to be able to specify a sorting
* order (and thus a priority) for getting applied by the {@code DispatcherServlet}. * order (and thus a priority) for getting applied by the {@code DispatcherServlet}.
* Non-Ordered instances get treated as lowest priority. * Non-Ordered instances get treated as the lowest priority.
* *
* @author Rod Johnson * @author Rod Johnson
* @author Juergen Hoeller * @author Juergen Hoeller
@ -50,7 +50,7 @@ import org.springframework.lang.Nullable;
public interface HandlerAdapter { public interface HandlerAdapter {
/** /**
* Given a handler instance, return whether or not this {@code HandlerAdapter} * Given a handler instance, return whether this {@code HandlerAdapter}
* can support it. Typical HandlerAdapters will base the decision on the handler * can support it. Typical HandlerAdapters will base the decision on the handler
* type. HandlerAdapters will usually only support one handler type each. * type. HandlerAdapters will usually only support one handler type each.
* <p>A typical implementation: * <p>A typical implementation:
@ -58,7 +58,7 @@ public interface HandlerAdapter {
* return (handler instanceof MyHandler); * return (handler instanceof MyHandler);
* } * }
* @param handler the handler object to check * @param handler the handler object to check
* @return whether or not this object can use the given handler * @return whether this object can use the given handler
*/ */
boolean supports(Object handler); boolean supports(Object handler);

View File

@ -45,7 +45,7 @@ import org.springframework.lang.Nullable;
* *
* <p>Note: Implementations can implement the {@link org.springframework.core.Ordered} * <p>Note: Implementations can implement the {@link org.springframework.core.Ordered}
* interface to be able to specify a sorting order and thus a priority for getting * interface to be able to specify a sorting order and thus a priority for getting
* applied by DispatcherServlet. Non-Ordered instances get treated as lowest priority. * applied by DispatcherServlet. Non-Ordered instances get treated as the lowest priority.
* *
* @author Rod Johnson * @author Rod Johnson
* @author Juergen Hoeller * @author Juergen Hoeller

View File

@ -58,7 +58,7 @@ public class ModelAndView {
@Nullable @Nullable
private HttpStatusCode status; private HttpStatusCode status;
/** Indicates whether or not this instance has been cleared with a call to {@link #clear()}. */ /** Indicates whether this instance has been cleared with a call to {@link #clear()}. */
private boolean cleared = false; private boolean cleared = false;
@ -216,7 +216,7 @@ public class ModelAndView {
} }
/** /**
* Indicate whether or not this {@code ModelAndView} has a view, either * Indicate whether this {@code ModelAndView} has a view, either
* as a view name or as a direct {@link View} instance. * as a view name or as a direct {@link View} instance.
*/ */
public boolean hasView() { public boolean hasView() {

View File

@ -90,7 +90,7 @@ public class DefaultServletHandlerConfigurer {
* Return a handler mapping instance ordered at {@link Ordered#LOWEST_PRECEDENCE} * Return a handler mapping instance ordered at {@link Ordered#LOWEST_PRECEDENCE}
* containing the {@link DefaultServletHttpRequestHandler} instance mapped * containing the {@link DefaultServletHttpRequestHandler} instance mapped
* to {@code "/**"}; or {@code null} if default servlet handling was not * to {@code "/**"}; or {@code null} if default servlet handling was not
* been enabled. * enabled.
* @since 4.3.12 * @since 4.3.12
*/ */
@Nullable @Nullable

View File

@ -1094,7 +1094,7 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
/** /**
* Register a {@link ViewResolverComposite} that contains a chain of view resolvers * Register a {@link ViewResolverComposite} that contains a chain of view resolvers
* to use for view resolution. * to use for view resolution.
* By default this resolver is ordered at 0 unless content negotiation view * By default, this resolver is ordered at 0 unless content negotiation view
* resolution is used in which case the order is raised to * resolution is used in which case the order is raised to
* {@link org.springframework.core.Ordered#HIGHEST_PRECEDENCE * {@link org.springframework.core.Ordered#HIGHEST_PRECEDENCE
* Ordered.HIGHEST_PRECEDENCE}. * Ordered.HIGHEST_PRECEDENCE}.
@ -1152,7 +1152,7 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
} }
/** /**
* Override this method to configure cross origin requests processing. * Override this method to configure cross-origin requests processing.
* @since 4.2 * @since 4.2
* @see CorsRegistry * @see CorsRegistry
*/ */

View File

@ -105,7 +105,7 @@ public interface WebMvcConfigurer {
} }
/** /**
* Configure "global" cross origin request processing. The configured CORS * Configure "global" cross-origin request processing. The configured CORS
* mappings apply to annotated controllers, functional endpoints, and static * mappings apply to annotated controllers, functional endpoints, and static
* resources. * resources.
* <p>Annotated controllers can further declare more fine-grained config via * <p>Annotated controllers can further declare more fine-grained config via

View File

@ -335,14 +335,14 @@ public abstract class RequestPredicates {
void method(Set<HttpMethod> methods); void method(Set<HttpMethod> methods);
/** /**
* Receive notification of an path predicate. * Receive notification of a path predicate.
* @param pattern the path pattern that makes up the predicate * @param pattern the path pattern that makes up the predicate
* @see RequestPredicates#path(String) * @see RequestPredicates#path(String)
*/ */
void path(String pattern); void path(String pattern);
/** /**
* Receive notification of an path extension predicate. * Receive notification of a path extension predicate.
* @param extension the path extension that makes up the predicate * @param extension the path extension that makes up the predicate
* @see RequestPredicates#pathExtension(String) * @see RequestPredicates#pathExtension(String)
*/ */

View File

@ -267,7 +267,7 @@ public interface ServerRequest {
* also with conditional POST/PUT/DELETE requests. * also with conditional POST/PUT/DELETE requests.
* <p><strong>Note:</strong> you can use either * <p><strong>Note:</strong> you can use either
* this {@code #checkNotModified(Instant)} method; or * this {@code #checkNotModified(Instant)} method; or
* {@link #checkNotModified(String)}. If you want enforce both * {@link #checkNotModified(String)}. If you want to enforce both
* a strong entity tag and a Last-Modified value, * a strong entity tag and a Last-Modified value,
* as recommended by the HTTP specification, * as recommended by the HTTP specification,
* then you should use {@link #checkNotModified(Instant, String)}. * then you should use {@link #checkNotModified(Instant, String)}.
@ -301,7 +301,7 @@ public interface ServerRequest {
* also with conditional POST/PUT/DELETE requests. * also with conditional POST/PUT/DELETE requests.
* <p><strong>Note:</strong> you can use either * <p><strong>Note:</strong> you can use either
* this {@link #checkNotModified(Instant)} method; or * this {@link #checkNotModified(Instant)} method; or
* {@code #checkNotModified(String)}. If you want enforce both * {@code #checkNotModified(String)}. If you want to enforce both
* a strong entity tag and a Last-Modified value, * a strong entity tag and a Last-Modified value,
* as recommended by the HTTP specification, * as recommended by the HTTP specification,
* then you should use {@link #checkNotModified(Instant, String)}. * then you should use {@link #checkNotModified(Instant, String)}.

View File

@ -150,8 +150,8 @@ public class RouterFunctionMapping extends AbstractHandlerMapping implements Ini
} }
/** /**
* Detect a all {@linkplain RouterFunction router functions} in the * Detect all {@linkplain RouterFunction router functions} in the current
* current application context. * application context.
*/ */
private void initRouterFunctions() { private void initRouterFunctions() {
List<RouterFunction<?>> routerFunctions = obtainApplicationContext() List<RouterFunction<?>> routerFunctions = obtainApplicationContext()

View File

@ -512,7 +512,7 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap
* Provide the mapping for a handler method. A method for which no * Provide the mapping for a handler method. A method for which no
* mapping can be provided is not a handler method. * mapping can be provided is not a handler method.
* @param method the method to provide a mapping for * @param method the method to provide a mapping for
* @param handlerType the handler type, possibly a sub-type of the method's * @param handlerType the handler type, possibly a subtype of the method's
* declaring class * declaring class
* @return the mapping, or {@code null} if the method is not mapped * @return the mapping, or {@code null} if the method is not mapped
*/ */

View File

@ -48,7 +48,7 @@ import org.springframework.web.util.pattern.PatternParseException;
* parsed} {@code RequestPath} which in turn depends on the * parsed} {@code RequestPath} which in turn depends on the
* {@link HandlerMapping} that matched the current request. * {@link HandlerMapping} that matched the current request.
* *
* <p>{@code MappedInterceptor} is supported by sub-classes of * <p>{@code MappedInterceptor} is supported by subclasses of
* {@link org.springframework.web.servlet.handler.AbstractHandlerMethodMapping * {@link org.springframework.web.servlet.handler.AbstractHandlerMethodMapping
* AbstractHandlerMethodMapping} which detect beans of type * AbstractHandlerMethodMapping} which detect beans of type
* {@code MappedInterceptor} and also check if interceptors directly registered * {@code MappedInterceptor} and also check if interceptors directly registered

View File

@ -117,7 +117,7 @@ public class SimpleUrlHandlerMapping extends AbstractUrlHandlerMapping {
} }
/** /**
* Allow Map access to the URL path mappings, with the option to add or * Allow {@code Map} access to the URL path mappings, with the option to add or
* override specific entries. * override specific entries.
* <p>Useful for specifying entries directly, for example via "urlMap[myKey]". * <p>Useful for specifying entries directly, for example via "urlMap[myKey]".
* This is particularly useful for adding or overriding entries in child * This is particularly useful for adding or overriding entries in child

View File

@ -35,7 +35,7 @@ import org.springframework.web.servlet.ModelAndView;
/** /**
* Spring Controller implementation that wraps a servlet instance which it manages * Spring Controller implementation that wraps a servlet instance which it manages
* internally. Such a wrapped servlet is not known outside of this controller; * internally. Such a wrapped servlet is not known outside this controller;
* its entire lifecycle is covered here (in contrast to {@link ServletForwardingController}). * its entire lifecycle is covered here (in contrast to {@link ServletForwardingController}).
* *
* <p>Useful to invoke an existing servlet via Spring's dispatching infrastructure, * <p>Useful to invoke an existing servlet via Spring's dispatching infrastructure,

View File

@ -56,7 +56,7 @@ import org.springframework.web.util.pattern.PathPatternParser;
* {@link PathPattern}s. The syntax is largely the same with the latter being * {@link PathPattern}s. The syntax is largely the same with the latter being
* more tailored for web usage and more efficient. The choice depends on the * more tailored for web usage and more efficient. The choice depends on the
* presence of a {@link UrlPathHelper#resolveAndCacheLookupPath resolved} * presence of a {@link UrlPathHelper#resolveAndCacheLookupPath resolved}
* {@code String} lookupPath or a {@link ServletRequestPathUtils#parseAndCache} * {@code String} lookupPath or a {@link ServletRequestPathUtils#parseAndCache
* parsed} {@code RequestPath} which in turn depends on the * parsed} {@code RequestPath} which in turn depends on the
* {@link HandlerMapping} that matched the current request. * {@link HandlerMapping} that matched the current request.
* *
@ -182,7 +182,7 @@ public class WebContentInterceptor extends WebContentGenerator implements Handle
/** /**
* Map specific URL paths to a specific {@link org.springframework.http.CacheControl}. * Map specific URL paths to a specific {@link org.springframework.http.CacheControl}.
* <p>Overrides the default cache seconds setting of this interceptor. * <p>Overrides the default cache seconds setting of this interceptor.
* Can specify a empty {@link org.springframework.http.CacheControl} instance * Can specify an empty {@link org.springframework.http.CacheControl} instance
* to exclude a URL path from default caching. * to exclude a URL path from default caching.
* <p>For pattern syntax see {@link AntPathMatcher} and {@link PathPattern} * <p>For pattern syntax see {@link AntPathMatcher} and {@link PathPattern}
* as well as the class-level Javadoc for details for when each is used. * as well as the class-level Javadoc for details for when each is used.

View File

@ -33,7 +33,7 @@ import org.springframework.lang.Nullable;
public abstract class AbstractRequestCondition<T extends AbstractRequestCondition<T>> implements RequestCondition<T> { public abstract class AbstractRequestCondition<T extends AbstractRequestCondition<T>> implements RequestCondition<T> {
/** /**
* Indicates whether this condition is empty, i.e. whether or not it * Indicates whether this condition is empty, i.e. whether it
* contains any discrete items. * contains any discrete items.
* @return {@code true} if empty; {@code false} otherwise * @return {@code true} if empty; {@code false} otherwise
*/ */

View File

@ -62,7 +62,7 @@ public abstract class AbstractHandlerMethodAdapter extends WebContentGenerator i
/** /**
* This implementation expects the handler to be an {@link HandlerMethod}. * This implementation expects the handler to be an {@link HandlerMethod}.
* @param handler the handler instance to check * @param handler the handler instance to check
* @return whether or not this adapter can adapt the given handler * @return whether this adapter can adapt the given handler
*/ */
@Override @Override
public final boolean supports(Object handler) { public final boolean supports(Object handler) {
@ -70,9 +70,9 @@ public abstract class AbstractHandlerMethodAdapter extends WebContentGenerator i
} }
/** /**
* Given a handler method, return whether or not this adapter can support it. * Given a handler method, return whether this adapter can support it.
* @param handlerMethod the handler method to check * @param handlerMethod the handler method to check
* @return whether or not this adapter can adapt the given method * @return whether this adapter can adapt the given method
*/ */
protected abstract boolean supportsInternal(HandlerMethod handlerMethod); protected abstract boolean supportsInternal(HandlerMethod handlerMethod);

View File

@ -298,7 +298,7 @@ public abstract class RequestMappingInfoHandlerMapping extends AbstractHandlerMe
} }
/** /**
* Whether there any partial matches. * Whether there are any partial matches.
*/ */
public boolean isEmpty() { public boolean isEmpty() {
return this.partialMatches.isEmpty(); return this.partialMatches.isEmpty();

View File

@ -38,7 +38,7 @@ import org.springframework.web.servlet.HandlerMapping;
/** /**
* Resolves arguments annotated with {@link MatrixVariable @MatrixVariable}. * Resolves arguments annotated with {@link MatrixVariable @MatrixVariable}.
* *
* <p>If the method parameter is of type {@link Map} it will by resolved by * <p>If the method parameter is of type {@link Map} it will be resolved by
* {@link MatrixVariableMapMethodArgumentResolver} instead unless the annotation * {@link MatrixVariableMapMethodArgumentResolver} instead unless the annotation
* specifies a name in which case it is considered to be a single attribute of * specifies a name in which case it is considered to be a single attribute of
* type map (vs multiple attributes collected in a map). * type map (vs multiple attributes collected in a map).

View File

@ -388,7 +388,7 @@ public class MvcUriComponentsBuilder {
* <p>The configured * <p>The configured
* {@link org.springframework.web.servlet.handler.HandlerMethodMappingNamingStrategy * {@link org.springframework.web.servlet.handler.HandlerMethodMappingNamingStrategy
* HandlerMethodMappingNamingStrategy} determines the names of controller * HandlerMethodMappingNamingStrategy} determines the names of controller
* method request mappings at startup. By default all mappings are assigned * method request mappings at startup. By default, all mappings are assigned
* a name based on the capital letters of the class name, followed by "#" as * a name based on the capital letters of the class name, followed by "#" as
* separator, and then the method name. For example "PC#getPerson" * separator, and then the method name. For example "PC#getPerson"
* for a class named PersonController with method getPerson. In case the * for a class named PersonController with method getPerson. In case the
@ -642,7 +642,7 @@ public class MvcUriComponentsBuilder {
contributor.contributeMethodArgument(param, args[i], builder, uriVars); contributor.contributeMethodArgument(param, args[i], builder, uriVars);
} }
// This may not be all the URI variables, supply what we have so far.. // This may not be all the URI variables, supply what we have so far.
return builder.uriVariables(uriVars); return builder.uriVariables(uriVars);
} }

View File

@ -94,7 +94,7 @@ public class RequestPartMethodArgumentResolver extends AbstractMessageConverterM
/** /**
* Whether the given {@linkplain MethodParameter method parameter} is * Whether the given {@linkplain MethodParameter method parameter} is
* supported as multi-part. Supports the following method parameters: * supported as multipart. Supports the following method parameters:
* <ul> * <ul>
* <li>annotated with {@code @RequestPart} * <li>annotated with {@code @RequestPart}
* <li>of type {@link MultipartFile} unless annotated with {@code @RequestParam} * <li>of type {@link MultipartFile} unless annotated with {@code @RequestParam}

View File

@ -48,7 +48,7 @@ import org.springframework.web.method.support.HandlerMethodReturnValueHandler;
import org.springframework.web.method.support.ModelAndViewContainer; import org.springframework.web.method.support.ModelAndViewContainer;
/** /**
* Handler for return values of type {@link ResponseBodyEmitter} and sub-classes * Handler for return values of type {@link ResponseBodyEmitter} and subclasses
* such as {@link SseEmitter} including the same types wrapped with * such as {@link SseEmitter} including the same types wrapped with
* {@link ResponseEntity}. * {@link ResponseEntity}.
* *

View File

@ -118,7 +118,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 (e.g. URI template
* variable, request parameter) using type conversion. * variable, request parameter) using type conversion.
* <p>The default implementation converts only if there a registered * <p>The default implementation converts only if there is a registered
* {@link Converter} that can perform the conversion. * {@link Converter} that can perform the conversion.
* @param sourceValue the source value to create the model attribute from * @param sourceValue the source value to create the model attribute from
* @param attributeName the name of the attribute (never {@code null}) * @param attributeName the name of the attribute (never {@code null})

View File

@ -33,9 +33,9 @@ import org.springframework.web.servlet.RequestToViewNameTranslator;
* as the actual return value is left as-is allowing the configured * as the actual return value is left as-is allowing the configured
* {@link RequestToViewNameTranslator} to select a view name by convention. * {@link RequestToViewNameTranslator} to select a view name by convention.
* *
* <p>A String return value can be interpreted in more than one ways depending on * <p>A String return value can be interpreted in more than one way depending on
* the presence of annotations like {@code @ModelAttribute} or {@code @ResponseBody}. * the presence of annotations like {@code @ModelAttribute} or {@code @ResponseBody}.
* Therefore this handler should be configured after the handlers that support these * Therefore, this handler should be configured after the handlers that support these
* annotations. * annotations.
* *
* @author Rossen Stoyanchev * @author Rossen Stoyanchev

View File

@ -290,7 +290,7 @@ public class DefaultHandlerExceptionResolver extends AbstractHandlerExceptionRes
/** /**
* Handle the case where no * Handle the case where no
* {@linkplain org.springframework.http.converter.HttpMessageConverter message converters} * {@linkplain org.springframework.http.converter.HttpMessageConverter message converters}
* were found that were acceptable for the client (expressed via the {@code Accept} header. * were found that were acceptable for the client (expressed via the {@code Accept} header).
* <p>The default implementation returns {@code null} in which case the * <p>The default implementation returns {@code null} in which case the
* exception is handled in {@link #handleErrorResponse}. * exception is handled in {@link #handleErrorResponse}.
* @param ex the HttpMediaTypeNotAcceptableException to be handled * @param ex the HttpMediaTypeNotAcceptableException to be handled

View File

@ -23,7 +23,7 @@ import org.springframework.util.DigestUtils;
import org.springframework.util.FileCopyUtils; import org.springframework.util.FileCopyUtils;
/** /**
* A {@code VersionStrategy} that calculates an Hex MD5 hashes from the content * 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, e.g.
* {@code "styles/main-e36d2e05253c6c7085a91522ce43a0b4.css"}. * {@code "styles/main-e36d2e05253c6c7085a91522ce43a0b4.css"}.
* *

View File

@ -65,7 +65,7 @@ public class PathResourceResolver extends AbstractResourceResolver {
/** /**
* By default when a Resource is found, the path of the resolved resource is * 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. * 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, e.g. when
* {@link org.springframework.web.servlet.resource.CssLinkResourceTransformer} * {@link org.springframework.web.servlet.resource.CssLinkResourceTransformer}
@ -203,9 +203,9 @@ public class PathResourceResolver extends AbstractResourceResolver {
/** /**
* Perform additional checks on a resolved resource beyond checking whether the * Perform additional checks on a resolved resource beyond checking whether the
* resources exists and is readable. The default implementation also verifies * resource exists and is readable. The default implementation also verifies
* the resource is either under the location relative to which it was found or * the resource is either under the location relative to which it was found or
* is under one of the {@link #setAllowedLocations allowed locations}. * is under one of the {@linkplain #setAllowedLocations allowed locations}.
* @param resource the resource to check * @param resource the resource to check
* @param location the location relative to which the resource was found * @param location the location relative to which the resource was found
* @return "true" if resource is in a valid location, "false" otherwise. * @return "true" if resource is in a valid location, "false" otherwise.

View File

@ -79,7 +79,7 @@ import org.springframework.web.util.UrlPathHelper;
* <p>This request handler may also be configured with a * <p>This request handler may also be configured with a
* {@link #setResourceResolvers(List) resourcesResolver} and * {@link #setResourceResolvers(List) resourcesResolver} and
* {@link #setResourceTransformers(List) resourceTransformer} chains to support * {@link #setResourceTransformers(List) resourceTransformer} chains to support
* arbitrary resolution and transformation of resources being served. By default * arbitrary resolution and transformation of resources being served. By default,
* a {@link PathResourceResolver} simply finds resources based on the configured * a {@link PathResourceResolver} simply finds resources based on the configured
* "locations". An application can configure additional resolvers and transformers * "locations". An application can configure additional resolvers and transformers
* such as the {@link VersionResourceResolver} which can resolve and prepare URLs * such as the {@link VersionResourceResolver} which can resolve and prepare URLs
@ -523,7 +523,7 @@ public class ResourceHttpRequestHandler extends WebContentGenerator
/** /**
* Initialize the strategy to use to determine the media type for a resource. * Initialize the strategy to use to determine the media type for a resource.
* @deprecated as of 5.2.4 this method returns {@code null}, and if a * @deprecated as of 5.2.4 this method returns {@code null}, and if a
* sub-class returns an actual instance,the instance is used only as a * subclass returns an actual instance, the instance is used only as a
* source of media type mappings, if it contains any. Please, use * source of media type mappings, if it contains any. Please, use
* {@link #setMediaTypes(Map)} instead, or if you need to change behavior, * {@link #setMediaTypes(Map)} instead, or if you need to change behavior,
* you can override {@link #getMediaType(HttpServletRequest, Resource)}. * you can override {@link #getMediaType(HttpServletRequest, Resource)}.
@ -719,7 +719,7 @@ public class ResourceHttpRequestHandler extends WebContentGenerator
} }
/** /**
* Identifies invalid resource paths. By default rejects: * Identifies invalid resource paths. By default, rejects:
* <ul> * <ul>
* <li>Paths that contain "WEB-INF" or "META-INF" * <li>Paths that contain "WEB-INF" or "META-INF"
* <li>Paths that contain "../" after a call to * <li>Paths that contain "../" after a call to

View File

@ -116,7 +116,7 @@ public class VersionResourceResolver extends AbstractResourceResolver {
* in Java config). * in Java config).
* <p>If not done already, variants of the given {@code pathPatterns}, prefixed with * <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 * the {@code version} will be also configured. For example, adding a {@code "/js/**"} path pattern
* will also cofigure automatically a {@code "/v1.0.0/js/**"} with {@code "v1.0.0"} the * will also configure automatically a {@code "/v1.0.0/js/**"} with {@code "v1.0.0"} the
* {@code version} String given as an argument. * {@code version} String given as an argument.
* @param version a version string * @param version a version string
* @param pathPatterns one or more resource URL path patterns, * @param pathPatterns one or more resource URL path patterns,

View File

@ -65,7 +65,7 @@ import org.springframework.web.util.WebUtils;
* <p>Can be instantiated manually, or automatically exposed to views as model attribute via AbstractView's * <p>Can be instantiated manually, or automatically exposed to views as model attribute via AbstractView's
* "requestContextAttribute" property. * "requestContextAttribute" property.
* *
* <p>Will also work outside of DispatcherServlet requests, accessing the root WebApplicationContext * <p>Will also work outside DispatcherServlet requests, accessing the root WebApplicationContext
* and using an appropriate fallback for the locale (the HttpServletRequest's primary locale). * and using an appropriate fallback for the locale (the HttpServletRequest's primary locale).
* *
* @author Juergen Hoeller * @author Juergen Hoeller
@ -134,7 +134,7 @@ public class RequestContext {
* <p>This only works with InternalResourceViews, as Errors instances are part of the model and not * <p>This only works with InternalResourceViews, as Errors instances are part of the model and not
* normally exposed as request attributes. It will typically be used within JSPs or custom tags. * normally exposed as request attributes. It will typically be used within JSPs or custom tags.
* <p><b>Will only work within a DispatcherServlet request.</b> * <p><b>Will only work within a DispatcherServlet request.</b>
* Pass in a ServletContext to be able to fallback to the root WebApplicationContext. * Pass in a ServletContext to be able to fall back to the root WebApplicationContext.
* @param request current HTTP request * @param request current HTTP request
* @see org.springframework.web.servlet.DispatcherServlet * @see org.springframework.web.servlet.DispatcherServlet
* @see #RequestContext(jakarta.servlet.http.HttpServletRequest, jakarta.servlet.ServletContext) * @see #RequestContext(jakarta.servlet.http.HttpServletRequest, jakarta.servlet.ServletContext)
@ -148,7 +148,7 @@ public class RequestContext {
* <p>This only works with InternalResourceViews, as Errors instances are part of the model and not * <p>This only works with InternalResourceViews, as Errors instances are part of the model and not
* normally exposed as request attributes. It will typically be used within JSPs or custom tags. * normally exposed as request attributes. It will typically be used within JSPs or custom tags.
* <p><b>Will only work within a DispatcherServlet request.</b> * <p><b>Will only work within a DispatcherServlet request.</b>
* Pass in a ServletContext to be able to fallback to the root WebApplicationContext. * Pass in a ServletContext to be able to fall back to the root WebApplicationContext.
* @param request current HTTP request * @param request current HTTP request
* @param response current HTTP response * @param response current HTTP response
* @see org.springframework.web.servlet.DispatcherServlet * @see org.springframework.web.servlet.DispatcherServlet
@ -178,7 +178,7 @@ public class RequestContext {
* Create a new RequestContext for the given request, using the given model attributes for Errors retrieval. * Create a new RequestContext for the given request, using the given model attributes for Errors retrieval.
* <p>This works with all View implementations. It will typically be used by View implementations. * <p>This works with all View implementations. It will typically be used by View implementations.
* <p><b>Will only work within a DispatcherServlet request.</b> * <p><b>Will only work within a DispatcherServlet request.</b>
* Pass in a ServletContext to be able to fallback to the root WebApplicationContext. * Pass in a ServletContext to be able to fall back to the root WebApplicationContext.
* @param request current HTTP request * @param request current HTTP request
* @param model the model attributes for the current view (can be {@code null}, * @param model the model attributes for the current view (can be {@code null},
* using the request attributes for Errors retrieval) * using the request attributes for Errors retrieval)

View File

@ -61,7 +61,7 @@ import org.springframework.web.util.JavaScriptUtils;
* <td>false</td> * <td>false</td>
* <td>true</td> * <td>true</td>
* <td>Set JavaScript escaping for this tag, as boolean value. * <td>Set JavaScript escaping for this tag, as boolean value.
* Default is false.</td> * Default is {@code false}.</td>
* </tr> * </tr>
* </tbody> * </tbody>
* </table> * </table>

View File

@ -73,7 +73,7 @@ import org.springframework.web.util.TagUtils;
* <td>false</td> * <td>false</td>
* <td>true</td> * <td>true</td>
* <td>Set JavaScript escaping for this tag, as a boolean value. * <td>Set JavaScript escaping for this tag, as a boolean value.
* Default is false.</td> * Default is {@code false}.</td>
* </tr> * </tr>
* <tr> * <tr>
* <td>scope</td> * <td>scope</td>

View File

@ -93,7 +93,7 @@ import org.springframework.web.util.TagUtils;
* <td>false</td> * <td>false</td>
* <td>true</td> * <td>true</td>
* <td>Set JavaScript escaping for this tag, as boolean value. * <td>Set JavaScript escaping for this tag, as boolean value.
* Default is false.</td> * Default is {@code false}.</td>
* </tr> * </tr>
* <tr> * <tr>
* <td>message</td> * <td>message</td>

View File

@ -24,7 +24,7 @@ import org.springframework.context.NoSuchMessageException;
* Messages are looked up using the ApplicationContext's ThemeSource, * Messages are looked up using the ApplicationContext's ThemeSource,
* and thus should support internationalization. * and thus should support internationalization.
* *
* <p>Regards a HTML escaping setting, either on this tag instance, * <p>Regards an HTML escaping setting, either on this tag instance,
* the page level, or the web.xml level. * the page level, or the web.xml level.
* *
* <p>If "code" isn't set or cannot be resolved, "text" will be used * <p>If "code" isn't set or cannot be resolved, "text" will be used
@ -78,7 +78,7 @@ import org.springframework.context.NoSuchMessageException;
* <td>false</td> * <td>false</td>
* <td>true</td> * <td>true</td>
* <td>Set JavaScript escaping for this tag, as boolean value. * <td>Set JavaScript escaping for this tag, as boolean value.
* Default is false.</td> * Default is {@code false}.</td>
* </tr> * </tr>
* <tr> * <tr>
* <td>message</td> * <td>message</td>

View File

@ -126,7 +126,7 @@ import org.springframework.web.util.UriUtils;
* <td>false</td> * <td>false</td>
* <td>true</td> * <td>true</td>
* <td>Set JavaScript escaping for this tag, as a boolean value. * <td>Set JavaScript escaping for this tag, as a boolean value.
* Default is false.</td> * Default is {@code false}.</td>
* </tr> * </tr>
* </tbody> * </tbody>
* </table> * </table>

View File

@ -35,7 +35,7 @@ import org.springframework.web.servlet.tags.NestedPathTag;
* Base tag for all data-binding aware JSP form tags. * Base tag for all data-binding aware JSP form tags.
* *
* <p>Provides the common {@link #setPath path} and {@link #setId id} properties. * <p>Provides the common {@link #setPath path} and {@link #setId id} properties.
* Provides sub-classes with utility methods for accessing the {@link BindStatus} * Provides subclasses with utility methods for accessing the {@link BindStatus}
* of their bound value and also for {@link #writeOptionalAttribute interacting} * of their bound value and also for {@link #writeOptionalAttribute interacting}
* with the {@link TagWriter}. * with the {@link TagWriter}.
* *
@ -111,10 +111,10 @@ public abstract class AbstractDataBoundFormElementTag extends AbstractFormTag im
/** /**
* Writes the default set of attributes to the supplied {@link TagWriter}. * Writes the default set of attributes to the supplied {@link TagWriter}.
* Further abstract sub-classes should override this method to add in * Further, abstract subclasses should override this method to add in
* any additional default attributes but <strong>must</strong> remember * any additional default attributes but <strong>must</strong> remember
* to call the {@code super} method. * to call the {@code super} method.
* <p>Concrete sub-classes should call this method when/if they want * <p>Concrete subclasses should call this method when/if they want
* to render default attributes. * to render default attributes.
* @param tagWriter the {@link TagWriter} to which any attributes are to be written * @param tagWriter the {@link TagWriter} to which any attributes are to be written
*/ */

View File

@ -278,7 +278,7 @@ public class PasswordInputTag extends InputTag {
} }
/** /**
* The {@link PasswordInputTag} only writes it's value if the * The {@link PasswordInputTag} only writes its value if the
* {@link #setShowPassword(boolean) 'showPassword'} property value is * {@link #setShowPassword(boolean) 'showPassword'} property value is
* {@link Boolean#TRUE true}. * {@link Boolean#TRUE true}.
*/ */

View File

@ -24,7 +24,7 @@ import jakarta.servlet.jsp.JspException;
* <p>Rendered elements are marked as 'checked' if the configured * <p>Rendered elements are marked as 'checked' if the configured
* {@link #setValue(Object) value} matches the {@link #getValue bound value}. * {@link #setValue(Object) value} matches the {@link #getValue bound value}.
* *
* <p>A typical usage pattern will involved multiple tag instances bound * <p>A typical usage pattern will involve multiple tag instances bound
* to the same property but with different values. * to the same property but with different values.
* *
* <p> * <p>

View File

@ -285,7 +285,7 @@ public class SelectTag extends AbstractHtmlInputElementTag {
private String size; private String size;
/** /**
* Indicates whether or not the '{@code select}' tag allows * Indicates whether the '{@code select}' tag allows
* multiple-selections. * multiple-selections.
*/ */
@Nullable @Nullable

View File

@ -22,7 +22,7 @@ import jakarta.servlet.jsp.PageContext;
* Utility class for generating '{@code id}' attributes values for JSP tags. Given the * Utility class for generating '{@code id}' attributes values for JSP tags. Given the
* name of a tag (the data bound path in most cases) returns a unique ID for that name within * name of a tag (the data bound path in most cases) returns a unique ID for that name within
* the current {@link PageContext}. Each request for an ID for a given name will append an * the current {@link PageContext}. Each request for an ID for a given name will append an
* ever increasing counter to the name itself. For instance, given the name '{@code person.name}', * ever-increasing counter to the name itself. For instance, given the name '{@code person.name}',
* the first request will give '{@code person.name1}' and the second will give * the first request will give '{@code person.name1}' and the second will give
* '{@code person.name2}'. This supports the common use case where a set of radio or check buttons * '{@code person.name2}'. This supports the common use case where a set of radio or check buttons
* are generated for the same data field, with each button being a distinct tag instance. * are generated for the same data field, with each button being a distinct tag instance.

View File

@ -53,7 +53,7 @@ public class SessionThemeResolver extends AbstractThemeResolver {
@Override @Override
public String resolveThemeName(HttpServletRequest request) { public String resolveThemeName(HttpServletRequest request) {
String themeName = (String) WebUtils.getSessionAttribute(request, THEME_SESSION_ATTRIBUTE_NAME); String themeName = (String) WebUtils.getSessionAttribute(request, THEME_SESSION_ATTRIBUTE_NAME);
// A specific theme indicated, or do we need to fallback to the default? // A specific theme indicated, or do we need to fall back to the default?
return (themeName != null ? themeName : getDefaultThemeName()); return (themeName != null ? themeName : getDefaultThemeName());
} }

View File

@ -188,10 +188,10 @@ public abstract class AbstractView extends WebApplicationObjectSupport implement
} }
/** /**
* Allow Map access to the static attributes of this view, * Allow {@code Map} access to the static attributes of this view,
* with the option to add or override specific entries. * with the option to add or override specific entries.
* <p>Useful for specifying entries directly, for example via * <p>Useful for specifying entries directly, for example via
* "attributesMap[myKey]". This is particularly useful for * {@code attributesMap[myKey]}. This is particularly useful for
* adding or overriding entries in child view definitions. * adding or overriding entries in child view definitions.
*/ */
public Map<String, Object> getAttributesMap() { public Map<String, Object> getAttributesMap() {
@ -225,7 +225,7 @@ public abstract class AbstractView extends WebApplicationObjectSupport implement
/** /**
* Specify whether to add path variables to the model or not. * Specify whether to add path variables to the model or not.
* <p>Path variables are commonly bound to URI template variables through the {@code @PathVariable} * <p>Path variables are commonly bound to URI template variables through the {@code @PathVariable}
* annotation. They're are effectively URI template variables with type conversion applied to * annotation. They are effectively URI template variables with type conversion applied to
* them to derive typed Object values. Such values are frequently needed in views for * them to derive typed Object values. Such values are frequently needed in views for
* constructing links to the same and other URLs. * constructing links to the same and other URLs.
* <p>Path variables added to the model override static attributes (see {@link #setAttributes(Properties)}) * <p>Path variables added to the model override static attributes (see {@link #setAttributes(Properties)})

View File

@ -98,7 +98,7 @@ public class DefaultRequestToViewNameTranslator implements RequestToViewNameTran
} }
/** /**
* Set whether or not leading slashes should be stripped from the URI when * Set whether leading slashes should be stripped from the URI when
* generating the view name. Default is "true". * generating the view name. Default is "true".
*/ */
public void setStripLeadingSlash(boolean stripLeadingSlash) { public void setStripLeadingSlash(boolean stripLeadingSlash) {
@ -106,7 +106,7 @@ public class DefaultRequestToViewNameTranslator implements RequestToViewNameTran
} }
/** /**
* Set whether or not trailing slashes should be stripped from the URI when * Set whether trailing slashes should be stripped from the URI when
* generating the view name. Default is "true". * generating the view name. Default is "true".
*/ */
public void setStripTrailingSlash(boolean stripTrailingSlash) { public void setStripTrailingSlash(boolean stripTrailingSlash) {
@ -114,7 +114,7 @@ public class DefaultRequestToViewNameTranslator implements RequestToViewNameTran
} }
/** /**
* Set whether or not file extensions should be stripped from the URI when * Set whether file extensions should be stripped from the URI when
* generating the view name. Default is "true". * generating the view name. Default is "true".
*/ */
public void setStripExtension(boolean stripExtension) { public void setStripExtension(boolean stripExtension) {

View File

@ -51,7 +51,7 @@ import org.springframework.web.util.WebUtils;
/** /**
* View that redirects to an absolute, context relative, or current request * View that redirects to an absolute, context relative, or current request
* relative URL. The URL may be a URI template in which case the URI template * relative URL. The URL may be a URI template in which case the URI template
* variables will be replaced with values available in the model. By default * variables will be replaced with values available in the model. By default,
* all primitive model attributes (or collections thereof) are exposed as HTTP * all primitive model attributes (or collections thereof) are exposed as HTTP
* query parameters (assuming they've not been used as URI template variables), * query parameters (assuming they've not been used as URI template variables),
* but this behavior can be changed by overriding the * but this behavior can be changed by overriding the
@ -160,7 +160,7 @@ public class RedirectView extends AbstractUrlBasedView implements SmartView {
* @param contextRelative whether to interpret the given URL as * @param contextRelative whether to interpret the given URL as
* relative to the current ServletContext * relative to the current ServletContext
* @param http10Compatible whether to stay compatible with HTTP 1.0 clients * @param http10Compatible whether to stay compatible with HTTP 1.0 clients
* @param exposeModelAttributes whether or not model attributes should be * @param exposeModelAttributes whether model attributes should be
* exposed as query parameters * exposed as query parameters
*/ */
public RedirectView(String url, boolean contextRelative, boolean http10Compatible, boolean exposeModelAttributes) { public RedirectView(String url, boolean contextRelative, boolean http10Compatible, boolean exposeModelAttributes) {
@ -202,7 +202,7 @@ public class RedirectView extends AbstractUrlBasedView implements SmartView {
/** /**
* Set the {@code exposeModelAttributes} flag which denotes whether * Set the {@code exposeModelAttributes} flag which denotes whether
* or not model attributes should be exposed as HTTP query parameters. * model attributes should be exposed as HTTP query parameters.
* <p>Defaults to {@code true}. * <p>Defaults to {@code true}.
*/ */
public void setExposeModelAttributes(final boolean exposeModelAttributes) { public void setExposeModelAttributes(final boolean exposeModelAttributes) {
@ -638,11 +638,11 @@ public class RedirectView extends AbstractUrlBasedView implements SmartView {
/** /**
* Whether the given targetUrl has a host that is a "foreign" system in which * Whether the given targetUrl has a host that is a "foreign" system in which
* case {@link HttpServletResponse#encodeRedirectURL} will not be applied. * case {@link HttpServletResponse#encodeRedirectURL} will not be applied.
* This method returns {@code true} if the {@link #setHosts(String[])} * <p>This method returns {@code true} if the {@link #setHosts(String[])}
* property is configured and the target URL has a host that does not match. * property is configured and the target URL has a host that does not match.
* @param targetUrl the target redirect URL * @param targetUrl the target redirect URL
* @return {@code true} the target URL has a remote host, {@code false} if it * @return {@code true} if the target URL has a remote host, {@code false} if
* the URL does not have a host or the "host" property is not configured. * the URL does not have a host or the "host" property is not configured
* @since 4.3 * @since 4.3
*/ */
protected boolean isRemoteHost(String targetUrl) { protected boolean isRemoteHost(String targetUrl) {

View File

@ -331,10 +331,10 @@ public class UrlBasedViewResolver extends AbstractCachingViewResolver implements
} }
/** /**
* Allow Map access to the static attributes for views returned by * Allow {@code Map} access to the static attributes for views returned by
* this resolver, with the option to add or override specific entries. * this resolver, with the option to add or override specific entries.
* <p>Useful for specifying entries directly, for example via * <p>Useful for specifying entries directly, for example via
* "attributesMap[myKey]". This is particularly useful for * {@code attributesMap[myKey]}. This is particularly useful for
* adding or overriding entries in child view definitions. * adding or overriding entries in child view definitions.
*/ */
public Map<String, Object> getAttributesMap() { public Map<String, Object> getAttributesMap() {
@ -492,7 +492,7 @@ public class UrlBasedViewResolver extends AbstractCachingViewResolver implements
} }
/** /**
* Indicates whether or not this {@link org.springframework.web.servlet.ViewResolver} can * Indicates whether this {@link org.springframework.web.servlet.ViewResolver} can
* handle the supplied view name. If not, {@link #createView(String, java.util.Locale)} will * handle the supplied view name. If not, {@link #createView(String, java.util.Locale)} will
* return {@code null}. The default implementation checks against the configured * return {@code null}. The default implementation checks against the configured
* {@link #setViewNames view names}. * {@link #setViewNames view names}.

View File

@ -99,7 +99,7 @@ public abstract class AbstractPdfStamperView extends AbstractUrlBasedView {
* *
* // set some values on the form * // set some values on the form
* form.setField("field1", "value1"); * form.setField("field1", "value1");
* form.setField("field2", "Vvlue2"); * form.setField("field2", "value2");
* *
* // set the disposition and filename * // set the disposition and filename
* response.setHeader("Content-disposition", "attachment; FILENAME=someName.pdf");</pre> * response.setHeader("Content-disposition", "attachment; FILENAME=someName.pdf");</pre>

View File

@ -94,7 +94,7 @@ import static org.springframework.http.MediaType.APPLICATION_JSON;
import static org.springframework.http.MediaType.APPLICATION_XML; import static org.springframework.http.MediaType.APPLICATION_XML;
/** /**
* A test fixture with a sub-class of {@link WebMvcConfigurationSupport} that also * A test fixture with a subclass of {@link WebMvcConfigurationSupport} that also
* implements the various {@link WebMvcConfigurer} extension points. * implements the various {@link WebMvcConfigurer} extension points.
* *
* The former doesn't implement the latter but the two must have compatible * The former doesn't implement the latter but the two must have compatible

View File

@ -314,7 +314,7 @@ class RequestMappingInfoHandlerMappingTests {
assertThat(matrixVariables.getFirst("year")).isEqualTo("2012"); assertThat(matrixVariables.getFirst("year")).isEqualTo("2012");
assertThat(uriVariables.get("cars")).isEqualTo("cars"); assertThat(uriVariables.get("cars")).isEqualTo("cars");
// URI var with regex for path variable, and URI var for matrix params.. // URI var with regex for path variable, and URI var for matrix params.
request = new MockHttpServletRequest("GET", "/cars;colors=red,blue,green;year=2012"); request = new MockHttpServletRequest("GET", "/cars;colors=red,blue,green;year=2012");
handleMatch(mapping, request, "/{cars:[^;]+}{params}", request.getRequestURI()); handleMatch(mapping, request, "/{cars:[^;]+}{params}", request.getRequestURI());
@ -329,7 +329,7 @@ class RequestMappingInfoHandlerMappingTests {
assertThat(uriVariables.get("params")).isEqualTo(";colors=red,blue,green;year=2012"); assertThat(uriVariables.get("params")).isEqualTo(";colors=red,blue,green;year=2012");
} }
// URI var with regex for path variable, and (empty) URI var for matrix params.. // URI var with regex for path variable, and (empty) URI var for matrix params.
request = new MockHttpServletRequest("GET", "/cars"); request = new MockHttpServletRequest("GET", "/cars");
handleMatch(mapping, request, "/{cars:[^;]+}{params}", request.getRequestURI()); handleMatch(mapping, request, "/{cars:[^;]+}{params}", request.getRequestURI());

View File

@ -47,7 +47,7 @@ import static org.mockito.Mockito.mock;
/** /**
* Base class for {@code @RequestAttribute} and {@code @SessionAttribute} method * Base class for {@code @RequestAttribute} and {@code @SessionAttribute} method
* method argument resolution tests. * argument resolution tests.
* *
* @author Rossen Stoyanchev * @author Rossen Stoyanchev
* @since 4.3 * @since 4.3

View File

@ -358,7 +358,7 @@ public class RequestMappingHandlerAdapterIntegrationTests {
assertThat(response.getStatus()).isEqualTo(HttpStatus.ACCEPTED.value()); assertThat(response.getStatus()).isEqualTo(HttpStatus.ACCEPTED.value());
assertThat(new String(response.getContentAsByteArray(), "UTF-8")).isEqualTo("Handled requestBody=[Hello Server]"); assertThat(new String(response.getContentAsByteArray(), "UTF-8")).isEqualTo("Handled requestBody=[Hello Server]");
assertThat(response.getHeader("header")).isEqualTo("headerValue"); assertThat(response.getHeader("header")).isEqualTo("headerValue");
// set because of @SesstionAttributes // set because of @SessionAttributes
assertThat(response.getHeader("Cache-Control")).isEqualTo("no-store"); assertThat(response.getHeader("Cache-Control")).isEqualTo("no-store");
} }