Merge branch '5.2.x'
# Conflicts: # build.gradle # spring-test/src/main/java/org/springframework/mock/http/server/reactive/MockServerHttpRequest.java # spring-web/src/main/java/org/springframework/http/HttpHeaders.java # spring-web/src/testFixtures/java/org/springframework/web/testfixture/http/server/reactive/MockServerHttpRequest.java
This commit is contained in:
@@ -114,7 +114,7 @@ configure(allprojects) { project ->
|
||||
dependency "net.sf.ehcache:ehcache:2.10.6"
|
||||
dependency "org.ehcache:jcache:1.0.1"
|
||||
dependency "org.ehcache:ehcache:3.4.0"
|
||||
dependency "org.hibernate:hibernate-core:5.4.16.Final"
|
||||
dependency "org.hibernate:hibernate-core:5.4.17.Final"
|
||||
dependency "org.hibernate:hibernate-validator:6.1.5.Final"
|
||||
dependency "org.webjars:webjars-locator-core:0.45"
|
||||
dependency "org.webjars:underscorejs:1.8.3"
|
||||
@@ -329,7 +329,7 @@ configure([rootProject] + javaProjects) { project ->
|
||||
}
|
||||
|
||||
checkstyle {
|
||||
toolVersion = "8.32"
|
||||
toolVersion = "8.33"
|
||||
configDirectory.set(rootProject.file("src/checkstyle"))
|
||||
}
|
||||
|
||||
|
||||
@@ -76,9 +76,8 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
|
||||
new InstanceComparator<>(
|
||||
Around.class, Before.class, After.class, AfterReturning.class, AfterThrowing.class),
|
||||
(Converter<Method, Annotation>) method -> {
|
||||
AspectJAnnotation<?> annotation =
|
||||
AbstractAspectJAdvisorFactory.findAspectJAnnotationOnMethod(method);
|
||||
return (annotation != null ? annotation.getAnnotation() : null);
|
||||
AspectJAnnotation<?> ann = AbstractAspectJAdvisorFactory.findAspectJAnnotationOnMethod(method);
|
||||
return (ann != null ? ann.getAnnotation() : null);
|
||||
});
|
||||
Comparator<Method> methodNameComparator = new ConvertingComparator<>(Method::getName);
|
||||
METHOD_COMPARATOR = adviceKindComparator.thenComparing(methodNameComparator);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -138,14 +138,8 @@ class AspectJPrecedenceComparator implements Comparator<Advisor> {
|
||||
}
|
||||
|
||||
private int getAspectDeclarationOrder(Advisor anAdvisor) {
|
||||
AspectJPrecedenceInformation precedenceInfo =
|
||||
AspectJAopUtils.getAspectJPrecedenceInformationFor(anAdvisor);
|
||||
if (precedenceInfo != null) {
|
||||
return precedenceInfo.getDeclarationOrder();
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
AspectJPrecedenceInformation precedenceInfo = AspectJAopUtils.getAspectJPrecedenceInformationFor(anAdvisor);
|
||||
return (precedenceInfo != null ? precedenceInfo.getDeclarationOrder() : 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -147,6 +147,15 @@ public interface ConfigurableApplicationContext extends ApplicationContext, Life
|
||||
*/
|
||||
void addApplicationListener(ApplicationListener<?> listener);
|
||||
|
||||
/**
|
||||
* Specify the ClassLoader to load class path resources and bean classes with.
|
||||
* <p>This context class loader will be passed to the internal bean factory.
|
||||
* @since 5.2.7
|
||||
* @see org.springframework.core.io.DefaultResourceLoader#DefaultResourceLoader(ClassLoader)
|
||||
* @see org.springframework.beans.factory.config.ConfigurableBeanFactory#setBeanClassLoader
|
||||
*/
|
||||
void setClassLoader(ClassLoader classLoader);
|
||||
|
||||
/**
|
||||
* Register the given protocol resolver with this application context,
|
||||
* allowing for additional resource protocols to be handled.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -158,7 +158,14 @@ public class GroovyScriptFactory implements ScriptFactory, BeanFactoryAware, Bea
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader classLoader) {
|
||||
this.groovyClassLoader = buildGroovyClassLoader(classLoader);
|
||||
if (classLoader instanceof GroovyClassLoader &&
|
||||
(this.compilerConfiguration == null ||
|
||||
((GroovyClassLoader) classLoader).hasCompatibleConfiguration(this.compilerConfiguration))) {
|
||||
this.groovyClassLoader = (GroovyClassLoader) classLoader;
|
||||
}
|
||||
else {
|
||||
this.groovyClassLoader = buildGroovyClassLoader(classLoader);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -64,10 +64,10 @@ public final class MockServerHttpRequest extends AbstractServerHttpRequest {
|
||||
private final MultiValueMap<String, HttpCookie> cookies;
|
||||
|
||||
@Nullable
|
||||
private final InetSocketAddress remoteAddress;
|
||||
private final InetSocketAddress localAddress;
|
||||
|
||||
@Nullable
|
||||
private final InetSocketAddress localAddress;
|
||||
private final InetSocketAddress remoteAddress;
|
||||
|
||||
@Nullable
|
||||
private final SslInfo sslInfo;
|
||||
@@ -103,18 +103,18 @@ public final class MockServerHttpRequest extends AbstractServerHttpRequest {
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public InetSocketAddress getRemoteAddress() {
|
||||
return this.remoteAddress;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public InetSocketAddress getLocalAddress() {
|
||||
return this.localAddress;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
@Nullable
|
||||
public InetSocketAddress getRemoteAddress() {
|
||||
return this.remoteAddress;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
protected SslInfo initSslInfo() {
|
||||
return this.sslInfo;
|
||||
}
|
||||
|
||||
@@ -385,7 +385,7 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
|
||||
* An empty {@code HttpHeaders} instance (immutable).
|
||||
* @since 5.0
|
||||
*/
|
||||
public static final HttpHeaders EMPTY = new ReadOnlyHttpHeaders(new HttpHeaders(new LinkedMultiValueMap<>(0)));
|
||||
public static final HttpHeaders EMPTY = new ReadOnlyHttpHeaders(new LinkedMultiValueMap<>());
|
||||
|
||||
/**
|
||||
* Pattern matching ETag multiple field values in headers such as "If-Match", "If-None-Match".
|
||||
@@ -1769,19 +1769,21 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
|
||||
|
||||
|
||||
/**
|
||||
* Apply a read-only {@code HttpHeaders} wrapper around the given headers
|
||||
* that also caches the parsed representations of the "Accept" and
|
||||
* "Content-Type" headers.
|
||||
* Apply a read-only {@code HttpHeaders} wrapper around the given headers, if necessary.
|
||||
* <p>Also caches the parsed representations of the "Accept" and "Content-Type" headers.
|
||||
* @param headers the headers to expose
|
||||
* @return a read-only variant of the headers, or the original headers as-is
|
||||
*/
|
||||
public static HttpHeaders readOnlyHttpHeaders(MultiValueMap<String, String> headers) {
|
||||
public static HttpHeaders readOnlyHttpHeaders(HttpHeaders headers) {
|
||||
Assert.notNull(headers, "HttpHeaders must not be null");
|
||||
return (headers instanceof ReadOnlyHttpHeaders ?
|
||||
(HttpHeaders) headers : new ReadOnlyHttpHeaders(headers));
|
||||
return (headers instanceof ReadOnlyHttpHeaders ? headers : new ReadOnlyHttpHeaders(headers.headers));
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove any read-only wrapper that may have been previously applied around
|
||||
* the given headers via {@link #readOnlyHttpHeaders(MultiValueMap)}.
|
||||
* the given headers via {@link #readOnlyHttpHeaders(HttpHeaders)}.
|
||||
* @param headers the headers to expose
|
||||
* @return a writable variant of the headers, or the original headers as-is
|
||||
* @since 5.1.1
|
||||
*/
|
||||
public static HttpHeaders writableHttpHeaders(HttpHeaders headers) {
|
||||
|
||||
@@ -195,20 +195,20 @@ class DefaultServerHttpRequestBuilder implements ServerHttpRequest.Builder {
|
||||
return this.originalRequest.getCookies();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public InetSocketAddress getRemoteAddress() {
|
||||
return this.originalRequest.getRemoteAddress();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public InetSocketAddress getLocalAddress() {
|
||||
return this.originalRequest.getLocalAddress();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
@Nullable
|
||||
public InetSocketAddress getRemoteAddress() {
|
||||
return this.originalRequest.getRemoteAddress();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
protected SslInfo initSslInfo() {
|
||||
return this.sslInfo;
|
||||
}
|
||||
|
||||
@@ -95,6 +95,7 @@ class ReactorServerHttpRequest extends AbstractServerHttpRequest {
|
||||
}
|
||||
else {
|
||||
InetSocketAddress localAddress = request.hostAddress();
|
||||
Assert.state(localAddress != null, "No host address available");
|
||||
return new URI(scheme, null, localAddress.getHostString(),
|
||||
localAddress.getPort(), null, null, null);
|
||||
}
|
||||
@@ -145,13 +146,15 @@ class ReactorServerHttpRequest extends AbstractServerHttpRequest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public InetSocketAddress getRemoteAddress() {
|
||||
return this.request.remoteAddress();
|
||||
@Nullable
|
||||
public InetSocketAddress getLocalAddress() {
|
||||
return this.request.hostAddress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public InetSocketAddress getLocalAddress() {
|
||||
return this.request.hostAddress();
|
||||
@Nullable
|
||||
public InetSocketAddress getRemoteAddress() {
|
||||
return this.request.remoteAddress();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -65,19 +65,19 @@ public interface ServerHttpRequest extends HttpRequest, ReactiveHttpInputMessage
|
||||
MultiValueMap<String, HttpCookie> getCookies();
|
||||
|
||||
/**
|
||||
* Return the remote address where this request is connected to, if available.
|
||||
* Return the local address the request was accepted on, if available.
|
||||
* @since 5.2.3
|
||||
*/
|
||||
@Nullable
|
||||
default InetSocketAddress getRemoteAddress() {
|
||||
default InetSocketAddress getLocalAddress() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the local address the request was accepted on, if available.
|
||||
* 5.2.3
|
||||
* Return the remote address where this request is connected to, if available.
|
||||
*/
|
||||
@Nullable
|
||||
default InetSocketAddress getLocalAddress() {
|
||||
default InetSocketAddress getRemoteAddress() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -97,17 +97,19 @@ public class ServerHttpRequestDecorator implements ServerHttpRequest {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public InetSocketAddress getLocalAddress() {
|
||||
return getDelegate().getLocalAddress();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public InetSocketAddress getRemoteAddress() {
|
||||
return getDelegate().getRemoteAddress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public InetSocketAddress getLocalAddress() {
|
||||
return getDelegate().getLocalAddress();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public SslInfo getSslInfo() {
|
||||
return getDelegate().getSslInfo();
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ import org.springframework.core.io.buffer.DefaultDataBufferFactory;
|
||||
import org.springframework.http.HttpCookie;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@@ -179,13 +180,15 @@ class ServletServerHttpRequest extends AbstractServerHttpRequest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public InetSocketAddress getRemoteAddress() {
|
||||
return new InetSocketAddress(this.request.getRemoteHost(), this.request.getRemotePort());
|
||||
@NonNull
|
||||
public InetSocketAddress getLocalAddress() {
|
||||
return new InetSocketAddress(this.request.getLocalAddr(), this.request.getLocalPort());
|
||||
}
|
||||
|
||||
@Override
|
||||
public InetSocketAddress getLocalAddress() {
|
||||
return new InetSocketAddress(this.request.getLocalAddr(), this.request.getLocalPort());
|
||||
@NonNull
|
||||
public InetSocketAddress getRemoteAddress() {
|
||||
return new InetSocketAddress(this.request.getRemoteHost(), this.request.getRemotePort());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -93,13 +93,15 @@ class UndertowServerHttpRequest extends AbstractServerHttpRequest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public InetSocketAddress getRemoteAddress() {
|
||||
return this.exchange.getSourceAddress();
|
||||
@Nullable
|
||||
public InetSocketAddress getLocalAddress() {
|
||||
return this.exchange.getDestinationAddress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public InetSocketAddress getLocalAddress() {
|
||||
return this.exchange.getDestinationAddress();
|
||||
@Nullable
|
||||
public InetSocketAddress getRemoteAddress() {
|
||||
return this.exchange.getSourceAddress();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -64,10 +64,10 @@ public final class MockServerHttpRequest extends AbstractServerHttpRequest {
|
||||
private final MultiValueMap<String, HttpCookie> cookies;
|
||||
|
||||
@Nullable
|
||||
private final InetSocketAddress remoteAddress;
|
||||
private final InetSocketAddress localAddress;
|
||||
|
||||
@Nullable
|
||||
private final InetSocketAddress localAddress;
|
||||
private final InetSocketAddress remoteAddress;
|
||||
|
||||
@Nullable
|
||||
private final SslInfo sslInfo;
|
||||
@@ -103,18 +103,18 @@ public final class MockServerHttpRequest extends AbstractServerHttpRequest {
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public InetSocketAddress getRemoteAddress() {
|
||||
return this.remoteAddress;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public InetSocketAddress getLocalAddress() {
|
||||
return this.localAddress;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
@Nullable
|
||||
public InetSocketAddress getRemoteAddress() {
|
||||
return this.remoteAddress;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
protected SslInfo initSslInfo() {
|
||||
return this.sslInfo;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -42,6 +42,7 @@ public class DelegatingWebFluxConfiguration extends WebFluxConfigurationSupport
|
||||
|
||||
private final WebFluxConfigurerComposite configurers = new WebFluxConfigurerComposite();
|
||||
|
||||
|
||||
@Autowired(required = false)
|
||||
public void setConfigurers(List<WebFluxConfigurer> configurers) {
|
||||
if (!CollectionUtils.isEmpty(configurers)) {
|
||||
@@ -49,6 +50,7 @@ public class DelegatingWebFluxConfiguration extends WebFluxConfigurationSupport
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void configureContentTypeResolver(RequestedContentTypeResolverBuilder builder) {
|
||||
this.configurers.configureContentTypeResolver(builder);
|
||||
@@ -100,4 +102,5 @@ public class DelegatingWebFluxConfiguration extends WebFluxConfigurationSupport
|
||||
protected void configureViewResolvers(ViewResolverRegistry registry) {
|
||||
this.configurers.configureViewResolvers(registry);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -93,10 +93,6 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
|
||||
@Nullable
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
@Nullable
|
||||
public final ApplicationContext getApplicationContext() {
|
||||
return this.applicationContext;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(@Nullable ApplicationContext applicationContext) {
|
||||
@@ -108,6 +104,12 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public final ApplicationContext getApplicationContext() {
|
||||
return this.applicationContext;
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public DispatcherHandler webHandler() {
|
||||
return new DispatcherHandler();
|
||||
@@ -122,6 +124,7 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
|
||||
@Bean
|
||||
public RequestMappingHandlerMapping requestMappingHandlerMapping(
|
||||
@Qualifier("webFluxContentTypeResolver") RequestedContentTypeResolver contentTypeResolver) {
|
||||
|
||||
RequestMappingHandlerMapping mapping = createRequestMappingHandlerMapping();
|
||||
mapping.setOrder(0);
|
||||
mapping.setContentTypeResolver(contentTypeResolver);
|
||||
@@ -205,7 +208,7 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
|
||||
@Bean
|
||||
public RouterFunctionMapping routerFunctionMapping(ServerCodecConfigurer serverCodecConfigurer) {
|
||||
RouterFunctionMapping mapping = createRouterFunctionMapping();
|
||||
mapping.setOrder(-1); // go before RequestMappingHandlerMapping
|
||||
mapping.setOrder(-1); // go before RequestMappingHandlerMapping
|
||||
mapping.setMessageReaders(serverCodecConfigurer.getReaders());
|
||||
mapping.setCorsConfigurations(getCorsConfigurations());
|
||||
|
||||
@@ -330,8 +333,8 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
|
||||
* initializing all {@link WebDataBinder} instances.
|
||||
*/
|
||||
protected ConfigurableWebBindingInitializer getConfigurableWebBindingInitializer(
|
||||
FormattingConversionService webFluxConversionService,
|
||||
Validator webFluxValidator) {
|
||||
FormattingConversionService webFluxConversionService, Validator webFluxValidator) {
|
||||
|
||||
ConfigurableWebBindingInitializer initializer = new ConfigurableWebBindingInitializer();
|
||||
initializer.setConversionService(webFluxConversionService);
|
||||
initializer.setValidator(webFluxValidator);
|
||||
@@ -430,6 +433,7 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
|
||||
@Qualifier("webFluxAdapterRegistry") ReactiveAdapterRegistry reactiveAdapterRegistry,
|
||||
ServerCodecConfigurer serverCodecConfigurer,
|
||||
@Qualifier("webFluxContentTypeResolver") RequestedContentTypeResolver contentTypeResolver) {
|
||||
|
||||
return new ResponseEntityResultHandler(serverCodecConfigurer.getWriters(),
|
||||
contentTypeResolver, reactiveAdapterRegistry);
|
||||
}
|
||||
@@ -439,6 +443,7 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
|
||||
@Qualifier("webFluxAdapterRegistry") ReactiveAdapterRegistry reactiveAdapterRegistry,
|
||||
ServerCodecConfigurer serverCodecConfigurer,
|
||||
@Qualifier("webFluxContentTypeResolver") RequestedContentTypeResolver contentTypeResolver) {
|
||||
|
||||
return new ResponseBodyResultHandler(serverCodecConfigurer.getWriters(),
|
||||
contentTypeResolver, reactiveAdapterRegistry);
|
||||
}
|
||||
@@ -447,6 +452,7 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
|
||||
public ViewResolutionResultHandler viewResolutionResultHandler(
|
||||
@Qualifier("webFluxAdapterRegistry") ReactiveAdapterRegistry reactiveAdapterRegistry,
|
||||
@Qualifier("webFluxContentTypeResolver") RequestedContentTypeResolver contentTypeResolver) {
|
||||
|
||||
ViewResolverRegistry registry = getViewResolverRegistry();
|
||||
List<ViewResolver> resolvers = registry.getViewResolvers();
|
||||
ViewResolutionResultHandler handler = new ViewResolutionResultHandler(
|
||||
@@ -457,8 +463,7 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ServerResponseResultHandler serverResponseResultHandler(
|
||||
ServerCodecConfigurer serverCodecConfigurer) {
|
||||
public ServerResponseResultHandler serverResponseResultHandler(ServerCodecConfigurer serverCodecConfigurer) {
|
||||
List<ViewResolver> resolvers = getViewResolverRegistry().getViewResolvers();
|
||||
ServerResponseResultHandler handler = new ServerResponseResultHandler();
|
||||
handler.setMessageWriters(serverCodecConfigurer.getWriters());
|
||||
|
||||
@@ -26,7 +26,6 @@ import java.util.Set;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
|
||||
/**
|
||||
* An {@link org.springframework.http.HttpHeaders} variant that adds support for
|
||||
@@ -71,7 +70,8 @@ public class WebSocketHttpHeaders extends HttpHeaders {
|
||||
|
||||
/**
|
||||
* Returns {@code WebSocketHttpHeaders} object that can only be read, not written to.
|
||||
* @deprecated as of 5.2.7 in favor of {@link HttpHeaders#readOnlyHttpHeaders(MultiValueMap)}
|
||||
* @deprecated as of 5.1.16, in favor of calling {@link #WebSocketHttpHeaders(HttpHeaders)}
|
||||
* with a read-only wrapper from {@link HttpHeaders#readOnlyHttpHeaders(HttpHeaders)}
|
||||
*/
|
||||
@Deprecated
|
||||
public static WebSocketHttpHeaders readOnlyWebSocketHttpHeaders(WebSocketHttpHeaders headers) {
|
||||
|
||||
@@ -159,9 +159,8 @@ The steps involved in using dynamic-language-backed beans are as follows:
|
||||
element in the XML configuration (you can define such beans programmatically by
|
||||
using the Spring API, although you will have to consult the source code for
|
||||
directions on how to do this, as this chapter does not cover this type of advanced configuration).
|
||||
Note that this is an iterative step. You need at least one bean
|
||||
definition for each dynamic language source file (although multiple bean definitions can reference the same dynamic language source
|
||||
file).
|
||||
Note that this is an iterative step. You need at least one bean definition for each dynamic
|
||||
language source file (although multiple bean definitions can reference the same source file).
|
||||
|
||||
The first two steps (testing and writing your dynamic language source files) are beyond
|
||||
the scope of this chapter. See the language specification and reference manual
|
||||
@@ -578,9 +577,12 @@ If you do not use the Spring namespace support, you can still use the
|
||||
<bean class="org.springframework.scripting.support.ScriptFactoryPostProcessor"/>
|
||||
----
|
||||
|
||||
NOTE: As of Spring Framework 4.3.3, you may also specify a Groovy `CompilationCustomizer`
|
||||
(such as an `ImportCustomizer`) or even a full Groovy `CompilerConfiguration` object
|
||||
in the same place as Spring's `GroovyObjectCustomizer`.
|
||||
NOTE: You may also specify a Groovy `CompilationCustomizer` (such as an `ImportCustomizer`)
|
||||
or even a full Groovy `CompilerConfiguration` object in the same place as Spring's
|
||||
`GroovyObjectCustomizer`. Furthermore, you may set a common `GroovyClassLoader` with custom
|
||||
configuration for your beans at the `ConfigurableApplicationContext.setClassLoader` level;
|
||||
this also leads to shared `GroovyClassLoader` usage and is therefore recommendable in case of
|
||||
a large number of scripted beans (avoiding an isolated `GroovyClassLoader` instance per bean).
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user