Merge branch '5.3.x'
# Conflicts: # spring-webflux/src/main/java/org/springframework/web/reactive/result/view/RedirectView.java
This commit is contained in:
commit
983c6e233f
|
|
@ -35,7 +35,7 @@ public interface HandlerAdapter {
|
|||
/**
|
||||
* Whether this {@code HandlerAdapter} supports the given {@code handler}.
|
||||
* @param handler the handler object to check
|
||||
* @return whether or not the handler is supported
|
||||
* @return whether the handler is supported
|
||||
*/
|
||||
boolean supports(Object handler);
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public interface HandlerResultHandler {
|
|||
/**
|
||||
* Whether this handler supports the given {@link HandlerResult}.
|
||||
* @param result the result object to check
|
||||
* @return whether or not this object can use the given result
|
||||
* @return whether this object can use the given result
|
||||
*/
|
||||
boolean supports(HandlerResult result);
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import org.springframework.web.server.NotAcceptableStatusException;
|
|||
import org.springframework.web.server.ServerWebExchange;
|
||||
|
||||
/**
|
||||
* Resolver that checks a query parameter and uses it to lookup a matching
|
||||
* Resolver that checks a query parameter and uses it to look up a matching
|
||||
* MediaType. Lookup keys can be registered or as a fallback
|
||||
* {@link MediaTypeFactory} can be used to perform a lookup.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
|
|||
}
|
||||
|
||||
/**
|
||||
* Override to plug a sub-class of {@link RequestMappingHandlerMapping}.
|
||||
* Override to plug a subclass of {@link RequestMappingHandlerMapping}.
|
||||
*/
|
||||
protected RequestMappingHandlerMapping createRequestMappingHandlerMapping() {
|
||||
return new RequestMappingHandlerMapping();
|
||||
|
|
@ -180,7 +180,7 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
|
|||
|
||||
/**
|
||||
* Callback for building the global CORS configuration. This method is final.
|
||||
* Use {@link #addCorsMappings(CorsRegistry)} to customize the CORS conifg.
|
||||
* Use {@link #addCorsMappings(CorsRegistry)} to customize the CORS config.
|
||||
*/
|
||||
protected final Map<String, CorsConfiguration> getCorsConfigurations() {
|
||||
if (this.corsConfigurations == null) {
|
||||
|
|
@ -192,7 +192,7 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
|
|||
}
|
||||
|
||||
/**
|
||||
* Override this method to configure cross origin requests processing.
|
||||
* Override this method to configure cross-origin requests processing.
|
||||
* @see CorsRegistry
|
||||
*/
|
||||
protected void addCorsMappings(CorsRegistry registry) {
|
||||
|
|
@ -226,7 +226,7 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
|
|||
}
|
||||
|
||||
/**
|
||||
* Override to plug a sub-class of {@link RouterFunctionMapping}.
|
||||
* Override to plug a subclass of {@link RouterFunctionMapping}.
|
||||
*/
|
||||
protected RouterFunctionMapping createRouterFunctionMapping() {
|
||||
return new RouterFunctionMapping();
|
||||
|
|
@ -289,7 +289,7 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
|
|||
}
|
||||
|
||||
/**
|
||||
* Override to plug a sub-class of {@link RequestMappingHandlerAdapter}.
|
||||
* Override to plug a subclass of {@link RequestMappingHandlerAdapter}.
|
||||
*/
|
||||
protected RequestMappingHandlerAdapter createRequestMappingHandlerAdapter() {
|
||||
return new RequestMappingHandlerAdapter();
|
||||
|
|
@ -314,7 +314,7 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
|
|||
}
|
||||
|
||||
/**
|
||||
* Override to plug a sub-class of {@link LocaleContextResolver}.
|
||||
* Override to plug a subclass of {@link LocaleContextResolver}.
|
||||
*/
|
||||
protected LocaleContextResolver createLocaleContextResolver() {
|
||||
return new AcceptHeaderLocaleContextResolver();
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ public interface WebFluxConfigurer {
|
|||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
* resources.
|
||||
* <p>Annotated controllers can further declare more fine-grained config via
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ public abstract class BodyExtractors {
|
|||
|
||||
Flux<T> result;
|
||||
if (message.getHeaders().getContentType() == null) {
|
||||
// Maybe it's okay there is no content type, if there is no content..
|
||||
// Maybe it's okay there is no content type, if there is no content.
|
||||
result = message.getBody().map(buffer -> {
|
||||
DataBufferUtils.release(buffer);
|
||||
throw ex;
|
||||
|
|
|
|||
|
|
@ -524,7 +524,7 @@ public class WebClientResponseException extends WebClientException {
|
|||
}
|
||||
|
||||
/**
|
||||
* {@link WebClientResponseException} for status HTTP HTTP 502 Bad Gateway.
|
||||
* {@link WebClientResponseException} for HTTP status 502 Bad Gateway.
|
||||
* @since 5.1
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
|
|
|
|||
|
|
@ -337,14 +337,14 @@ public abstract class RequestPredicates {
|
|||
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
|
||||
* @see RequestPredicates#path(String)
|
||||
*/
|
||||
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
|
||||
* @see RequestPredicates#pathExtension(String)
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ public abstract class RouterFunctions {
|
|||
* for additional filter and exception handler registration through
|
||||
* {@link WebHttpHandlerBuilder}.
|
||||
* @param routerFunction the router function to convert
|
||||
* @return an http handler that handles HTTP request using the given router function
|
||||
* @return an HTTP handler that handles HTTP request using the given router function
|
||||
*/
|
||||
public static HttpHandler toHttpHandler(RouterFunction<?> routerFunction) {
|
||||
return toHttpHandler(routerFunction, HandlerStrategies.withDefaults());
|
||||
|
|
@ -225,7 +225,7 @@ public abstract class RouterFunctions {
|
|||
* </ul>
|
||||
* @param routerFunction the router function to convert
|
||||
* @param strategies the strategies to use
|
||||
* @return an http handler that handles HTTP request using the given router function
|
||||
* @return an HTTP handler that handles HTTP request using the given router function
|
||||
*/
|
||||
public static HttpHandler toHttpHandler(RouterFunction<?> routerFunction, HandlerStrategies strategies) {
|
||||
WebHandler webHandler = toWebHandler(routerFunction, strategies);
|
||||
|
|
|
|||
|
|
@ -318,7 +318,7 @@ public interface ServerRequest {
|
|||
* also with conditional POST/PUT/DELETE requests.
|
||||
* <p><strong>Note:</strong> you can use either
|
||||
* 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,
|
||||
* as recommended by the HTTP specification,
|
||||
* then you should use {@link #checkNotModified(Instant, String)}.
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ public abstract class AbstractHandlerMapping extends ApplicationObjectSupport
|
|||
/**
|
||||
* Return the {@link PathPatternParser} instance that is used for
|
||||
* {@link #setCorsConfigurations(Map) CORS configuration checks}.
|
||||
* Sub-classes can also use this pattern parser for their own request
|
||||
* Subclasses can also use this pattern parser for their own request
|
||||
* mapping purposes.
|
||||
*/
|
||||
public PathPatternParser getPathPatternParser() {
|
||||
|
|
@ -114,7 +114,7 @@ public abstract class AbstractHandlerMapping extends ApplicationObjectSupport
|
|||
}
|
||||
|
||||
/**
|
||||
* Set the "global" CORS configurations based on URL patterns. By default the
|
||||
* Set the "global" CORS configurations based on URL patterns. By default, the
|
||||
* first matching URL pattern is combined with handler-level CORS configuration if any.
|
||||
* @see #setCorsConfigurationSource(CorsConfigurationSource)
|
||||
*/
|
||||
|
|
@ -131,7 +131,7 @@ public abstract class AbstractHandlerMapping extends ApplicationObjectSupport
|
|||
}
|
||||
|
||||
/**
|
||||
* Set the "global" CORS configuration source. By default the first matching URL
|
||||
* Set the "global" CORS configuration source. By default, the first matching URL
|
||||
* pattern is combined with the CORS configuration for the handler, if any.
|
||||
* @since 5.1
|
||||
* @see #setCorsConfigurations(Map)
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public abstract class AbstractUrlHandlerMapping extends AbstractHandlerMapping {
|
|||
|
||||
/**
|
||||
* Return a read-only view of registered path patterns and handlers which may
|
||||
* may be an actual handler instance or the bean name of lazily initialized
|
||||
* be an actual handler instance or the bean name of lazily initialized
|
||||
* handler.
|
||||
*/
|
||||
public final Map<PathPattern, Object> getHandlerMap() {
|
||||
|
|
|
|||
|
|
@ -113,7 +113,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.
|
||||
* <p>Useful for specifying entries directly, for example via "urlMap[myKey]".
|
||||
* This is particularly useful for adding or overriding entries in child
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import org.springframework.util.DigestUtils;
|
|||
import org.springframework.util.StreamUtils;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* {@code "styles/main-e36d2e05253c6c7085a91522ce43a0b4.css"}.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -52,7 +52,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.
|
||||
* However sometimes that may not be the case, e.g. when
|
||||
* {@link CssLinkResourceTransformer}
|
||||
|
|
@ -146,7 +146,7 @@ public class PathResourceResolver extends AbstractResourceResolver {
|
|||
|
||||
/**
|
||||
* 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
|
||||
* is under one of the {@link #setAllowedLocations allowed locations}.
|
||||
* @param resource the resource to check
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ public class VersionResourceResolver extends AbstractResourceResolver {
|
|||
* in Java config).
|
||||
* <p>If not done already, variants of the given {@code pathPatterns}, prefixed with
|
||||
* the {@code version} will be also configured. For example, adding a {@code "/js/**"} path pattern
|
||||
* 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.
|
||||
* @param version a version string
|
||||
* @param pathPatterns one or more resource URL path patterns,
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public abstract class HandlerResultHandlerSupport implements Ordered {
|
|||
/**
|
||||
* Set the order for this result handler relative to others.
|
||||
* <p>By default set to {@link Ordered#LOWEST_PRECEDENCE}, however see
|
||||
* Javadoc of sub-classes which may change this default.
|
||||
* Javadoc of subclasses which may change this default.
|
||||
* @param order the order
|
||||
*/
|
||||
public void setOrder(int order) {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import org.springframework.lang.Nullable;
|
|||
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.
|
||||
* @return {@code true} if empty; {@code false} otherwise
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -427,7 +427,7 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap
|
|||
* Provide the mapping for a handler method. A method for which no
|
||||
* mapping can be provided is not a handler method.
|
||||
* @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
|
||||
* @return the mapping, or {@code null} if the method is not mapped
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ public class InvocableHandlerMethod extends HandlerMethod {
|
|||
|
||||
|
||||
/**
|
||||
* Configure the argument resolvers to use to use for resolving method
|
||||
* Configure the argument resolvers to use for resolving method
|
||||
* argument values against a {@code ServerWebExchange}.
|
||||
*/
|
||||
public void setArgumentResolvers(List<? extends HandlerMethodArgumentResolver> resolvers) {
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ public abstract class RequestMappingInfoHandlerMapping extends AbstractHandlerMe
|
|||
|
||||
|
||||
/**
|
||||
* Whether there any partial matches.
|
||||
* Whether there are any partial matches.
|
||||
*/
|
||||
public boolean isEmpty() {
|
||||
return this.partialMatches.isEmpty();
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class SyncInvocableHandlerMethod extends HandlerMethod {
|
|||
|
||||
|
||||
/**
|
||||
* Configure the argument resolvers to use to use for resolving method
|
||||
* Configure the argument resolvers to use for resolving method
|
||||
* argument values against a {@code ServerWebExchange}.
|
||||
*/
|
||||
public void setArgumentResolvers(List<SyncHandlerMethodArgumentResolver> resolvers) {
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ public abstract class AbstractMessageReaderArgumentResolver extends HandlerMetho
|
|||
}
|
||||
}
|
||||
|
||||
// No compatible reader but body may be empty..
|
||||
// No compatible reader but body may be empty.
|
||||
|
||||
HttpMethod method = request.getMethod();
|
||||
if (contentType == null && SUPPORTED_METHODS.contains(method)) {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ import org.springframework.web.server.ServerWebExchange;
|
|||
|
||||
/**
|
||||
* An extension of {@link AbstractNamedValueArgumentResolver} for named value
|
||||
* resolvers that are synchronous and yet non-blocking. Sub-classes implement
|
||||
* resolvers that are synchronous and yet non-blocking. Subclasses implement
|
||||
* the synchronous {@link #resolveNamedValue} to which the asynchronous
|
||||
* {@link #resolveName} delegates to by default.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ import org.springframework.web.server.ServerWebInputException;
|
|||
/**
|
||||
* 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
|
||||
* specifies a name in which case it is considered to be a single attribute of
|
||||
* type map (vs multiple attributes collected in a map).
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import org.springframework.web.server.ServerWebExchange;
|
|||
* Resolver for a controller method argument of type {@link Model} that can
|
||||
* also be resolved as a {@link java.util.Map}.
|
||||
*
|
||||
* <p>A Map return value can be interpreted in more than one ways depending
|
||||
* <p>A Map return value can be interpreted in more than one way depending
|
||||
* on the presence of annotations like {@code @ModelAttribute} or
|
||||
* {@code @ResponseBody}. As of 5.2 this resolver returns false if a
|
||||
* parameter of type {@code Map} is also annotated.
|
||||
|
|
|
|||
|
|
@ -298,10 +298,10 @@ public class RedirectView extends AbstractUrlBasedView {
|
|||
/**
|
||||
* Whether the given targetUrl has a host that is a "foreign" system in which
|
||||
* case {@link jakarta.servlet.http.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.
|
||||
* @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
|
||||
*/
|
||||
protected boolean isRemoteHost(String targetUrl) {
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ public class UrlBasedViewResolver extends ViewResolverSupport
|
|||
}
|
||||
|
||||
/**
|
||||
* Indicates whether or not this {@link ViewResolver} can handle the supplied
|
||||
* Indicates whether this {@link ViewResolver} can handle the supplied
|
||||
* view name. If not, an empty result is returned. The default implementation
|
||||
* checks against the configured {@link #setViewNames view names}.
|
||||
* @param viewName the name of the view to retrieve
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public interface View {
|
|||
}
|
||||
|
||||
/**
|
||||
* Whether this View does rendering by performing a redirect.
|
||||
* Whether this View does render by performing a redirect.
|
||||
*/
|
||||
default boolean isRedirectView() {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ public abstract class AbstractListenerWebSocketSession<T> extends AbstractWebSoc
|
|||
}
|
||||
|
||||
/**
|
||||
* Sub-classes can invoke this before sending a message (false) and
|
||||
* Subclasses can invoke this before sending a message (false) and
|
||||
* after receiving the async send callback (true) effective translating
|
||||
* async completion callback into simple flow control.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -290,7 +290,7 @@ public class DefaultWebClientTests {
|
|||
.defaultCookie("baz", "qux")
|
||||
.build();
|
||||
|
||||
// Now, verify what each client has..
|
||||
// Now, verify what each client has.
|
||||
|
||||
WebClient.Builder builder1 = client1.mutate();
|
||||
builder1.filters(filters -> assertThat(filters.size()).isEqualTo(1));
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ import static org.springframework.web.bind.annotation.RequestMethod.PUT;
|
|||
*/
|
||||
public class RequestMethodsRequestConditionTests {
|
||||
|
||||
// TODO: custom method, CORS pre-flight (see @Disabledd)
|
||||
// TODO: custom method, CORS pre-flight (see @Disabled)
|
||||
|
||||
@Test
|
||||
public void getMatchingCondition() throws Exception {
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ public class RequestMappingMessageConversionIntegrationTests extends AbstractReq
|
|||
assertThat(responseEntity.getBody()).isNull();
|
||||
|
||||
// As we're on the same connection, the 2nd request proves server response handling
|
||||
// did complete after the 1st request..
|
||||
// did complete after the 1st request.
|
||||
responseEntity = performGet("/person-response/mono-empty", JSON, Person.class);
|
||||
assertThat(responseEntity.getHeaders().getContentLength()).isEqualTo(0);
|
||||
assertThat(responseEntity.getBody()).isNull();
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ import org.springframework.web.testfixture.http.server.reactive.bootstrap.Tomcat
|
|||
import org.springframework.web.testfixture.http.server.reactive.bootstrap.UndertowHttpServer;
|
||||
|
||||
/**
|
||||
* Base class for WebSocket integration tests. Sub-classes must implement
|
||||
* Base class for WebSocket integration tests. Subclasses must implement
|
||||
* {@link #getWebConfigClass()} to return Spring config class with (server-side)
|
||||
* handler mappings to {@code WebSocketHandler}'s.
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue