Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
28bba876
Commit
28bba876
authored
Mar 06, 2017
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.4.x' into 1.5.x
parents
3cdc81c3
9fb9a67c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
23 deletions
+30
-23
EmbeddedServletContainerAutoConfiguration.java
...figure/web/EmbeddedServletContainerAutoConfiguration.java
+10
-5
EmbeddedServletContainerCustomizerBeanPostProcessor.java
.../EmbeddedServletContainerCustomizerBeanPostProcessor.java
+10
-9
ErrorPageRegistrarBeanPostProcessor.java
...boot/web/servlet/ErrorPageRegistrarBeanPostProcessor.java
+10
-9
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/EmbeddedServletContainerAutoConfiguration.java
View file @
28bba876
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
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.
...
...
@@ -58,6 +58,7 @@ import org.springframework.util.ObjectUtils;
* @author Phillip Webb
* @author Dave Syer
* @author Ivan Sopov
* @author Stephane Nicoll
*/
@AutoConfigureOrder
(
Ordered
.
HIGHEST_PRECEDENCE
)
@Configuration
...
...
@@ -136,17 +137,21 @@ public class EmbeddedServletContainerAutoConfiguration {
if
(
ObjectUtils
.
isEmpty
(
this
.
beanFactory
.
getBeanNamesForType
(
EmbeddedServletContainerCustomizerBeanPostProcessor
.
class
,
true
,
false
)))
{
RootBeanDefinition
beanDefinition
=
new
RootBeanDefinition
(
EmbeddedServletContainerCustomizerBeanPostProcessor
.
class
);
beanDefinition
.
setSynthetic
(
true
);
registry
.
registerBeanDefinition
(
"embeddedServletContainerCustomizerBeanPostProcessor"
,
new
RootBeanDefinition
(
EmbeddedServletContainerCustomizerBeanPostProcessor
.
class
));
beanDefinition
);
}
if
(
ObjectUtils
.
isEmpty
(
this
.
beanFactory
.
getBeanNamesForType
(
ErrorPageRegistrarBeanPostProcessor
.
class
,
true
,
false
)))
{
RootBeanDefinition
beanDefinition
=
new
RootBeanDefinition
(
ErrorPageRegistrarBeanPostProcessor
.
class
);
beanDefinition
.
setSynthetic
(
true
);
registry
.
registerBeanDefinition
(
"errorPageRegistrarBeanPostProcessor"
,
new
RootBeanDefinition
(
ErrorPageRegistrarBeanPostProcessor
.
class
));
beanDefinition
);
}
}
...
...
spring-boot/src/main/java/org/springframework/boot/context/embedded/EmbeddedServletContainerCustomizerBeanPostProcessor.java
View file @
28bba876
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
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.
...
...
@@ -22,9 +22,10 @@ import java.util.Collections;
import
java.util.List
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.factory.BeanFactory
;
import
org.springframework.beans.factory.BeanFactoryAware
;
import
org.springframework.beans.factory.ListableBeanFactory
;
import
org.springframework.beans.factory.config.BeanPostProcessor
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContextAware
;
import
org.springframework.core.annotation.AnnotationAwareOrderComparator
;
/**
...
...
@@ -33,18 +34,18 @@ import org.springframework.core.annotation.AnnotationAwareOrderComparator;
*
* @author Dave Syer
* @author Phillip Webb
* @author Stephane Nicoll
*/
public
class
EmbeddedServletContainerCustomizerBeanPostProcessor
implements
BeanPostProcessor
,
ApplicationContext
Aware
{
implements
BeanPostProcessor
,
BeanFactory
Aware
{
private
ApplicationContext
applicationContext
;
private
ListableBeanFactory
beanFactory
;
private
List
<
EmbeddedServletContainerCustomizer
>
customizers
;
@Override
public
void
setApplicationContext
(
ApplicationContext
applicationContext
)
throws
BeansException
{
this
.
applicationContext
=
applicationContext
;
public
void
setBeanFactory
(
BeanFactory
beanFactory
)
{
this
.
beanFactory
=
(
ListableBeanFactory
)
beanFactory
;
}
@Override
...
...
@@ -73,7 +74,7 @@ public class EmbeddedServletContainerCustomizerBeanPostProcessor
if
(
this
.
customizers
==
null
)
{
// Look up does not include the parent context
this
.
customizers
=
new
ArrayList
<
EmbeddedServletContainerCustomizer
>(
this
.
applicationContext
this
.
beanFactory
.
getBeansOfType
(
EmbeddedServletContainerCustomizer
.
class
,
false
,
false
)
.
values
());
...
...
spring-boot/src/main/java/org/springframework/boot/web/servlet/ErrorPageRegistrarBeanPostProcessor.java
View file @
28bba876
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
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.
...
...
@@ -22,9 +22,10 @@ import java.util.Collections;
import
java.util.List
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.factory.BeanFactory
;
import
org.springframework.beans.factory.BeanFactoryAware
;
import
org.springframework.beans.factory.ListableBeanFactory
;
import
org.springframework.beans.factory.config.BeanPostProcessor
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContextAware
;
import
org.springframework.core.annotation.AnnotationAwareOrderComparator
;
/**
...
...
@@ -32,19 +33,19 @@ import org.springframework.core.annotation.AnnotationAwareOrderComparator;
* factory to {@link ErrorPageRegistry} beans.
*
* @author Phillip Webb
* @author Stephane Nicoll
* @since 1.4.0
*/
public
class
ErrorPageRegistrarBeanPostProcessor
implements
BeanPostProcessor
,
ApplicationContext
Aware
{
implements
BeanPostProcessor
,
BeanFactory
Aware
{
private
ApplicationContext
applicationContext
;
private
ListableBeanFactory
beanFactory
;
private
List
<
ErrorPageRegistrar
>
registrars
;
@Override
public
void
setApplicationContext
(
ApplicationContext
applicationContext
)
throws
BeansException
{
this
.
applicationContext
=
applicationContext
;
public
void
setBeanFactory
(
BeanFactory
beanFactory
)
{
this
.
beanFactory
=
(
ListableBeanFactory
)
beanFactory
;
}
@Override
...
...
@@ -71,7 +72,7 @@ public class ErrorPageRegistrarBeanPostProcessor
private
Collection
<
ErrorPageRegistrar
>
getRegistrars
()
{
if
(
this
.
registrars
==
null
)
{
// Look up does not include the parent context
this
.
registrars
=
new
ArrayList
<
ErrorPageRegistrar
>(
this
.
applicationContext
this
.
registrars
=
new
ArrayList
<
ErrorPageRegistrar
>(
this
.
beanFactory
.
getBeansOfType
(
ErrorPageRegistrar
.
class
,
false
,
false
).
values
());
Collections
.
sort
(
this
.
registrars
,
AnnotationAwareOrderComparator
.
INSTANCE
);
this
.
registrars
=
Collections
.
unmodifiableList
(
this
.
registrars
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment