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
07462be0
Commit
07462be0
authored
Nov 11, 2017
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
89173bd2
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
46 additions
and
35 deletions
+46
-35
Token.java
...mework/boot/actuate/autoconfigure/cloudfoundry/Token.java
+2
-1
CompositeHandlerExceptionResolverTests.java
...e/web/servlet/CompositeHandlerExceptionResolverTests.java
+10
-5
SpringIntegrationMetrics.java
...actuate/metrics/integration/SpringIntegrationMetrics.java
+2
-2
ConditionEvaluationReportLoggingListener.java
...ure/logging/ConditionEvaluationReportLoggingListener.java
+2
-1
ConditionEvaluationReportLoggingListenerTests.java
...ogging/ConditionEvaluationReportLoggingListenerTests.java
+1
-2
DefaultErrorWebExceptionHandlerIntegrationTest.java
...error/DefaultErrorWebExceptionHandlerIntegrationTest.java
+2
-2
TestPropertyValuesTests.java
...ringframework/boot/test/util/TestPropertyValuesTests.java
+4
-3
OriginTrackedPropertiesLoader.java
...ringframework/boot/env/OriginTrackedPropertiesLoader.java
+2
-2
JettyWebServer.java
...ringframework/boot/web/embedded/jetty/JettyWebServer.java
+2
-3
NettyReactiveWebServerFactory.java
...oot/web/embedded/netty/NettyReactiveWebServerFactory.java
+2
-1
SslServerCustomizer.java
...ramework/boot/web/embedded/netty/SslServerCustomizer.java
+10
-6
TomcatReactiveWebServerFactory.java
...t/web/embedded/tomcat/TomcatReactiveWebServerFactory.java
+1
-1
TomcatServletWebServerFactory.java
...ot/web/embedded/tomcat/TomcatServletWebServerFactory.java
+2
-1
TomcatWebServer.java
...ngframework/boot/web/embedded/tomcat/TomcatWebServer.java
+2
-2
TomcatServletWebServerFactoryTests.java
...b/embedded/tomcat/TomcatServletWebServerFactoryTests.java
+2
-1
SampleTomcatApplicationTests.java
...test/java/sample/tomcat/SampleTomcatApplicationTests.java
+0
-1
SampleUndertowApplicationTests.java
.../java/sample/undertow/SampleUndertowApplicationTests.java
+0
-1
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/Token.java
View file @
07462be0
...
@@ -61,7 +61,8 @@ public class Token {
...
@@ -61,7 +61,8 @@ public class Token {
private
Map
<
String
,
Object
>
parseJson
(
String
base64
)
{
private
Map
<
String
,
Object
>
parseJson
(
String
base64
)
{
try
{
try
{
byte
[]
bytes
=
Base64Utils
.
decodeFromUrlSafeString
(
base64
);
byte
[]
bytes
=
Base64Utils
.
decodeFromUrlSafeString
(
base64
);
return
JsonParserFactory
.
getJsonParser
().
parseMap
(
new
String
(
bytes
,
StandardCharsets
.
UTF_8
));
return
JsonParserFactory
.
getJsonParser
()
.
parseMap
(
new
String
(
bytes
,
StandardCharsets
.
UTF_8
));
}
}
catch
(
RuntimeException
ex
)
{
catch
(
RuntimeException
ex
)
{
throw
new
CloudFoundryAuthorizationException
(
Reason
.
INVALID_TOKEN
,
throw
new
CloudFoundryAuthorizationException
(
Reason
.
INVALID_TOKEN
,
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerExceptionResolverTests.java
View file @
07462be0
...
@@ -50,16 +50,20 @@ public class CompositeHandlerExceptionResolverTests {
...
@@ -50,16 +50,20 @@ public class CompositeHandlerExceptionResolverTests {
@Test
@Test
public
void
resolverShouldDelegateToOtherResolversInContext
()
throws
Exception
{
public
void
resolverShouldDelegateToOtherResolversInContext
()
throws
Exception
{
load
(
TestConfiguration
.
class
);
load
(
TestConfiguration
.
class
);
CompositeHandlerExceptionResolver
resolver
=
(
CompositeHandlerExceptionResolver
)
this
.
context
.
getBean
(
DispatcherServlet
.
HANDLER_EXCEPTION_RESOLVER_BEAN_NAME
);
CompositeHandlerExceptionResolver
resolver
=
(
CompositeHandlerExceptionResolver
)
this
.
context
ModelAndView
resolved
=
resolver
.
resolveException
(
this
.
request
,
this
.
response
,
null
,
new
HttpRequestMethodNotSupportedException
(
"POST"
));
.
getBean
(
DispatcherServlet
.
HANDLER_EXCEPTION_RESOLVER_BEAN_NAME
);
ModelAndView
resolved
=
resolver
.
resolveException
(
this
.
request
,
this
.
response
,
null
,
new
HttpRequestMethodNotSupportedException
(
"POST"
));
assertThat
(
resolved
.
getViewName
()).
isEqualTo
(
"test-view"
);
assertThat
(
resolved
.
getViewName
()).
isEqualTo
(
"test-view"
);
}
}
@Test
@Test
public
void
resolverShouldAddDefaultResolverIfNonePresent
()
throws
Exception
{
public
void
resolverShouldAddDefaultResolverIfNonePresent
()
throws
Exception
{
load
(
BaseConfiguration
.
class
);
load
(
BaseConfiguration
.
class
);
CompositeHandlerExceptionResolver
resolver
=
(
CompositeHandlerExceptionResolver
)
this
.
context
.
getBean
(
DispatcherServlet
.
HANDLER_EXCEPTION_RESOLVER_BEAN_NAME
);
CompositeHandlerExceptionResolver
resolver
=
(
CompositeHandlerExceptionResolver
)
this
.
context
ModelAndView
resolved
=
resolver
.
resolveException
(
this
.
request
,
this
.
response
,
null
,
new
HttpRequestMethodNotSupportedException
(
"POST"
));
.
getBean
(
DispatcherServlet
.
HANDLER_EXCEPTION_RESOLVER_BEAN_NAME
);
ModelAndView
resolved
=
resolver
.
resolveException
(
this
.
request
,
this
.
response
,
null
,
new
HttpRequestMethodNotSupportedException
(
"POST"
));
assertThat
(
resolved
).
isNotNull
();
assertThat
(
resolved
).
isNotNull
();
}
}
...
@@ -94,7 +98,8 @@ public class CompositeHandlerExceptionResolverTests {
...
@@ -94,7 +98,8 @@ public class CompositeHandlerExceptionResolverTests {
static
class
TestHandlerExceptionResolver
implements
HandlerExceptionResolver
{
static
class
TestHandlerExceptionResolver
implements
HandlerExceptionResolver
{
@Override
@Override
public
ModelAndView
resolveException
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
Exception
ex
)
{
public
ModelAndView
resolveException
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
,
Exception
ex
)
{
return
new
ModelAndView
(
"test-view"
);
return
new
ModelAndView
(
"test-view"
);
}
}
...
...
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/integration/SpringIntegrationMetrics.java
View file @
07462be0
...
@@ -150,8 +150,8 @@ public class SpringIntegrationMetrics implements MeterBinder, SmartInitializingS
...
@@ -150,8 +150,8 @@ public class SpringIntegrationMetrics implements MeterBinder, SmartInitializingS
private
<
T
>
void
registerFunctionCounter
(
MeterRegistry
registry
,
T
object
,
private
<
T
>
void
registerFunctionCounter
(
MeterRegistry
registry
,
T
object
,
Iterable
<
Tag
>
tags
,
String
name
,
String
description
,
Iterable
<
Tag
>
tags
,
String
name
,
String
description
,
ToDoubleFunction
<
T
>
value
)
{
ToDoubleFunction
<
T
>
value
)
{
FunctionCounter
.
builder
(
name
,
object
,
value
).
tags
(
tags
)
FunctionCounter
.
builder
(
name
,
object
,
value
).
tags
(
tags
)
.
description
(
description
)
.
description
(
description
).
register
(
registry
);
.
register
(
registry
);
}
}
@Override
@Override
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggingListener.java
View file @
07462be0
...
@@ -57,7 +57,8 @@ public class ConditionEvaluationReportLoggingListener
...
@@ -57,7 +57,8 @@ public class ConditionEvaluationReportLoggingListener
@Override
@Override
public
void
initialize
(
ConfigurableApplicationContext
applicationContext
)
{
public
void
initialize
(
ConfigurableApplicationContext
applicationContext
)
{
this
.
applicationContext
=
applicationContext
;
this
.
applicationContext
=
applicationContext
;
applicationContext
.
addApplicationListener
(
new
ConditionEvaluationReportListener
());
applicationContext
.
addApplicationListener
(
new
ConditionEvaluationReportListener
());
if
(
applicationContext
instanceof
GenericApplicationContext
)
{
if
(
applicationContext
instanceof
GenericApplicationContext
)
{
// Get the report early in case the context fails to load
// Get the report early in case the context fails to load
this
.
report
=
ConditionEvaluationReport
this
.
report
=
ConditionEvaluationReport
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/logging/ConditionEvaluationReportLoggingListenerTests.java
View file @
07462be0
...
@@ -147,8 +147,7 @@ public class ConditionEvaluationReportLoggingListenerTests {
...
@@ -147,8 +147,7 @@ public class ConditionEvaluationReportLoggingListenerTests {
private
void
withDebugLogging
(
Runnable
runnable
)
{
private
void
withDebugLogging
(
Runnable
runnable
)
{
LoggerContext
context
=
(
LoggerContext
)
StaticLoggerBinder
.
getSingleton
()
LoggerContext
context
=
(
LoggerContext
)
StaticLoggerBinder
.
getSingleton
()
.
getLoggerFactory
();
.
getLoggerFactory
();
Logger
logger
=
context
Logger
logger
=
context
.
getLogger
(
ConditionEvaluationReportLoggingListener
.
class
);
.
getLogger
(
ConditionEvaluationReportLoggingListener
.
class
);
Level
currentLevel
=
logger
.
getLevel
();
Level
currentLevel
=
logger
.
getLevel
();
logger
.
setLevel
(
Level
.
DEBUG
);
logger
.
setLevel
(
Level
.
DEBUG
);
try
{
try
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorWebExceptionHandlerIntegrationTest.java
View file @
07462be0
...
@@ -203,10 +203,10 @@ public class DefaultErrorWebExceptionHandlerIntegrationTest {
...
@@ -203,10 +203,10 @@ public class DefaultErrorWebExceptionHandlerIntegrationTest {
@Target
(
ElementType
.
TYPE
)
@Target
(
ElementType
.
TYPE
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Retention
(
RetentionPolicy
.
RUNTIME
)
@Documented
@Documented
@Import
({
ReactiveWebServerAutoConfiguration
.
class
,
@Import
({
ReactiveWebServerAutoConfiguration
.
class
,
HttpHandlerAutoConfiguration
.
class
,
WebFluxAutoConfiguration
.
class
,
HttpHandlerAutoConfiguration
.
class
,
WebFluxAutoConfiguration
.
class
,
ErrorWebFluxAutoConfiguration
.
class
,
ErrorWebFluxAutoConfiguration
.
class
,
PropertyPlaceholderAutoConfiguration
.
class
})
PropertyPlaceholderAutoConfiguration
.
class
})
private
@interface
MinimalWebConfiguration
{
private
@interface
MinimalWebConfiguration
{
}
}
...
...
spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/util/TestPropertyValuesTests.java
View file @
07462be0
...
@@ -54,7 +54,8 @@ public class TestPropertyValuesTests {
...
@@ -54,7 +54,8 @@ public class TestPropertyValuesTests {
@Test
@Test
public
void
applyToSystemPropertySource
()
throws
Exception
{
public
void
applyToSystemPropertySource
()
throws
Exception
{
TestPropertyValues
.
of
(
"FOO_BAR=BAZ"
).
applyTo
(
this
.
environment
,
Type
.
SYSTEM_ENVIRONMENT
);
TestPropertyValues
.
of
(
"FOO_BAR=BAZ"
).
applyTo
(
this
.
environment
,
Type
.
SYSTEM_ENVIRONMENT
);
assertThat
(
this
.
environment
.
getProperty
(
"foo.bar"
)).
isEqualTo
(
"BAZ"
);
assertThat
(
this
.
environment
.
getProperty
(
"foo.bar"
)).
isEqualTo
(
"BAZ"
);
assertThat
(
this
.
environment
.
getPropertySources
().
contains
(
assertThat
(
this
.
environment
.
getPropertySources
().
contains
(
"test-"
+
StandardEnvironment
.
SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME
));
"test-"
+
StandardEnvironment
.
SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME
));
...
@@ -72,8 +73,8 @@ public class TestPropertyValuesTests {
...
@@ -72,8 +73,8 @@ public class TestPropertyValuesTests {
throws
Exception
{
throws
Exception
{
TestPropertyValues
.
of
(
"foo.bar=baz"
,
"hello.world=hi"
).
applyTo
(
this
.
environment
,
TestPropertyValues
.
of
(
"foo.bar=baz"
,
"hello.world=hi"
).
applyTo
(
this
.
environment
,
Type
.
MAP
,
"other"
);
Type
.
MAP
,
"other"
);
TestPropertyValues
.
of
(
"FOO_BAR=BAZ"
).
applyTo
(
this
.
environment
,
Type
.
SYSTEM_ENVIRONMENT
,
TestPropertyValues
.
of
(
"FOO_BAR=BAZ"
).
applyTo
(
this
.
environment
,
"other"
);
Type
.
SYSTEM_ENVIRONMENT
,
"other"
);
assertThat
(
this
.
environment
.
getPropertySources
().
get
(
"other"
))
assertThat
(
this
.
environment
.
getPropertySources
().
get
(
"other"
))
.
isInstanceOf
(
SystemEnvironmentPropertySource
.
class
);
.
isInstanceOf
(
SystemEnvironmentPropertySource
.
class
);
assertThat
(
this
.
environment
.
getProperty
(
"foo.bar"
)).
isEqualTo
(
"BAZ"
);
assertThat
(
this
.
environment
.
getProperty
(
"foo.bar"
)).
isEqualTo
(
"BAZ"
);
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/env/OriginTrackedPropertiesLoader.java
View file @
07462be0
...
@@ -155,8 +155,8 @@ class OriginTrackedPropertiesLoader {
...
@@ -155,8 +155,8 @@ class OriginTrackedPropertiesLoader {
private
int
character
;
private
int
character
;
CharacterReader
(
Resource
resource
)
throws
IOException
{
CharacterReader
(
Resource
resource
)
throws
IOException
{
this
.
reader
=
new
LineNumberReader
(
this
.
reader
=
new
LineNumberReader
(
new
InputStreamReader
(
new
InputStreamReader
(
resource
.
getInputStream
(),
StandardCharsets
.
ISO_8859_1
));
resource
.
getInputStream
(),
StandardCharsets
.
ISO_8859_1
));
}
}
@Override
@Override
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/jetty/JettyWebServer.java
View file @
07462be0
...
@@ -197,9 +197,8 @@ public class JettyWebServer implements WebServer {
...
@@ -197,9 +197,8 @@ public class JettyWebServer implements WebServer {
private
String
getContextPath
()
{
private
String
getContextPath
()
{
return
Arrays
.
stream
(
this
.
server
.
getHandlers
())
return
Arrays
.
stream
(
this
.
server
.
getHandlers
())
.
filter
(
ContextHandler
.
class
::
isInstance
)
.
filter
(
ContextHandler
.
class
::
isInstance
).
map
(
ContextHandler
.
class
::
cast
)
.
map
(
handler
->
((
ContextHandler
)
handler
).
getContextPath
())
.
map
(
ContextHandler:
:
getContextPath
).
collect
(
Collectors
.
joining
(
" "
));
.
collect
(
Collectors
.
joining
(
" "
));
}
}
private
void
handleDeferredInitialize
(
Handler
...
handlers
)
throws
Exception
{
private
void
handleDeferredInitialize
(
Handler
...
handlers
)
throws
Exception
{
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactory.java
View file @
07462be0
...
@@ -91,7 +91,8 @@ public class NettyReactiveWebServerFactory extends AbstractReactiveWebServerFact
...
@@ -91,7 +91,8 @@ public class NettyReactiveWebServerFactory extends AbstractReactiveWebServerFact
return
HttpServer
.
builder
().
options
((
options
)
->
{
return
HttpServer
.
builder
().
options
((
options
)
->
{
options
.
listenAddress
(
getListenAddress
());
options
.
listenAddress
(
getListenAddress
());
if
(
getSsl
()
!=
null
&&
getSsl
().
isEnabled
())
{
if
(
getSsl
()
!=
null
&&
getSsl
().
isEnabled
())
{
SslServerCustomizer
sslServerCustomizer
=
new
SslServerCustomizer
(
getSsl
(),
getSslStoreProvider
());
SslServerCustomizer
sslServerCustomizer
=
new
SslServerCustomizer
(
getSsl
(),
getSslStoreProvider
());
sslServerCustomizer
.
customize
(
options
);
sslServerCustomizer
.
customize
(
options
);
}
}
applyCustomizers
(
options
);
applyCustomizers
(
options
);
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/SslServerCustomizer.java
View file @
07462be0
...
@@ -31,8 +31,8 @@ import org.springframework.boot.web.server.SslStoreProvider;
...
@@ -31,8 +31,8 @@ import org.springframework.boot.web.server.SslStoreProvider;
import
org.springframework.util.ResourceUtils
;
import
org.springframework.util.ResourceUtils
;
/**
/**
* {@link NettyServerCustomizer} that configures SSL for the
* {@link NettyServerCustomizer} that configures SSL for the
given Reactor Netty server
*
given Reactor Netty server
instance.
* instance.
*
*
* @author Brian Clozel
* @author Brian Clozel
*/
*/
...
@@ -66,7 +66,8 @@ public class SslServerCustomizer implements NettyServerCustomizer {
...
@@ -66,7 +66,8 @@ public class SslServerCustomizer implements NettyServerCustomizer {
}
}
}
}
protected
KeyManagerFactory
getKeyManagerFactory
(
Ssl
ssl
,
SslStoreProvider
sslStoreProvider
)
{
protected
KeyManagerFactory
getKeyManagerFactory
(
Ssl
ssl
,
SslStoreProvider
sslStoreProvider
)
{
try
{
try
{
KeyStore
keyStore
=
getKeyStore
(
ssl
,
sslStoreProvider
);
KeyStore
keyStore
=
getKeyStore
(
ssl
,
sslStoreProvider
);
KeyManagerFactory
keyManagerFactory
=
KeyManagerFactory
KeyManagerFactory
keyManagerFactory
=
KeyManagerFactory
...
@@ -84,7 +85,8 @@ public class SslServerCustomizer implements NettyServerCustomizer {
...
@@ -84,7 +85,8 @@ public class SslServerCustomizer implements NettyServerCustomizer {
}
}
}
}
private
KeyStore
getKeyStore
(
Ssl
ssl
,
SslStoreProvider
sslStoreProvider
)
throws
Exception
{
private
KeyStore
getKeyStore
(
Ssl
ssl
,
SslStoreProvider
sslStoreProvider
)
throws
Exception
{
if
(
sslStoreProvider
!=
null
)
{
if
(
sslStoreProvider
!=
null
)
{
return
sslStoreProvider
.
getKeyStore
();
return
sslStoreProvider
.
getKeyStore
();
}
}
...
@@ -92,7 +94,8 @@ public class SslServerCustomizer implements NettyServerCustomizer {
...
@@ -92,7 +94,8 @@ public class SslServerCustomizer implements NettyServerCustomizer {
ssl
.
getKeyStorePassword
());
ssl
.
getKeyStorePassword
());
}
}
protected
TrustManagerFactory
getTrustManagerFactory
(
Ssl
ssl
,
SslStoreProvider
sslStoreProvider
)
{
protected
TrustManagerFactory
getTrustManagerFactory
(
Ssl
ssl
,
SslStoreProvider
sslStoreProvider
)
{
try
{
try
{
KeyStore
store
=
getTrustStore
(
ssl
,
sslStoreProvider
);
KeyStore
store
=
getTrustStore
(
ssl
,
sslStoreProvider
);
TrustManagerFactory
trustManagerFactory
=
TrustManagerFactory
TrustManagerFactory
trustManagerFactory
=
TrustManagerFactory
...
@@ -105,7 +108,8 @@ public class SslServerCustomizer implements NettyServerCustomizer {
...
@@ -105,7 +108,8 @@ public class SslServerCustomizer implements NettyServerCustomizer {
}
}
}
}
private
KeyStore
getTrustStore
(
Ssl
ssl
,
SslStoreProvider
sslStoreProvider
)
throws
Exception
{
private
KeyStore
getTrustStore
(
Ssl
ssl
,
SslStoreProvider
sslStoreProvider
)
throws
Exception
{
if
(
sslStoreProvider
!=
null
)
{
if
(
sslStoreProvider
!=
null
)
{
return
sslStoreProvider
.
getTrustStore
();
return
sslStoreProvider
.
getTrustStore
();
}
}
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatReactiveWebServerFactory.java
View file @
07462be0
...
@@ -57,7 +57,7 @@ public class TomcatReactiveWebServerFactory extends AbstractReactiveWebServerFac
...
@@ -57,7 +57,7 @@ public class TomcatReactiveWebServerFactory extends AbstractReactiveWebServerFac
private
String
protocol
=
DEFAULT_PROTOCOL
;
private
String
protocol
=
DEFAULT_PROTOCOL
;
private
List
<
LifecycleListener
>
contextLifecycleListeners
=
new
ArrayList
<
LifecycleListener
>(
private
List
<
LifecycleListener
>
contextLifecycleListeners
=
new
ArrayList
<>(
Collections
.
singleton
(
new
AprLifecycleListener
()));
Collections
.
singleton
(
new
AprLifecycleListener
()));
private
List
<
TomcatContextCustomizer
>
tomcatContextCustomizers
=
new
ArrayList
<>();
private
List
<
TomcatContextCustomizer
>
tomcatContextCustomizers
=
new
ArrayList
<>();
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactory.java
View file @
07462be0
...
@@ -224,7 +224,8 @@ public class TomcatServletWebServerFactory extends AbstractServletWebServerFacto
...
@@ -224,7 +224,8 @@ public class TomcatServletWebServerFactory extends AbstractServletWebServerFacto
private
void
configureTldSkipPatterns
(
TomcatEmbeddedContext
context
)
{
private
void
configureTldSkipPatterns
(
TomcatEmbeddedContext
context
)
{
StandardJarScanFilter
filter
=
new
StandardJarScanFilter
();
StandardJarScanFilter
filter
=
new
StandardJarScanFilter
();
filter
.
setTldSkip
(
StringUtils
.
collectionToCommaDelimitedString
(
this
.
tldSkipPatterns
));
filter
.
setTldSkip
(
StringUtils
.
collectionToCommaDelimitedString
(
this
.
tldSkipPatterns
));
context
.
getJarScanner
().
setJarScanFilter
(
filter
);
context
.
getJarScanner
().
setJarScanFilter
(
filter
);
}
}
...
...
spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/tomcat/TomcatWebServer.java
View file @
07462be0
...
@@ -329,8 +329,8 @@ public class TomcatWebServer implements WebServer {
...
@@ -329,8 +329,8 @@ public class TomcatWebServer implements WebServer {
private
String
getContextPath
()
{
private
String
getContextPath
()
{
return
Arrays
.
stream
(
this
.
tomcat
.
getHost
().
findChildren
())
return
Arrays
.
stream
(
this
.
tomcat
.
getHost
().
findChildren
())
.
filter
(
TomcatEmbeddedContext
.
class
::
isInstance
)
.
filter
(
TomcatEmbeddedContext
.
class
::
isInstance
)
.
map
(
context
->
((
TomcatEmbeddedContext
)
context
).
getPath
()
)
.
map
(
TomcatEmbeddedContext
.
class
::
cast
)
.
collect
(
Collectors
.
joining
(
" "
));
.
map
(
TomcatEmbeddedContext:
:
getPath
).
collect
(
Collectors
.
joining
(
" "
));
}
}
/**
/**
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/TomcatServletWebServerFactoryTests.java
View file @
07462be0
...
@@ -398,7 +398,8 @@ public class TomcatServletWebServerFactoryTests
...
@@ -398,7 +398,8 @@ public class TomcatServletWebServerFactoryTests
Tomcat
tomcat
=
((
TomcatWebServer
)
this
.
webServer
).
getTomcat
();
Tomcat
tomcat
=
((
TomcatWebServer
)
this
.
webServer
).
getTomcat
();
Context
context
=
(
Context
)
tomcat
.
getHost
().
findChildren
()[
0
];
Context
context
=
(
Context
)
tomcat
.
getHost
().
findChildren
()[
0
];
JarScanFilter
jarScanFilter
=
context
.
getJarScanner
().
getJarScanFilter
();
JarScanFilter
jarScanFilter
=
context
.
getJarScanner
().
getJarScanFilter
();
Set
<
String
>
tldSkipSet
=
(
Set
<
String
>)
ReflectionTestUtils
.
getField
(
jarScanFilter
,
"tldSkipSet"
);
Set
<
String
>
tldSkipSet
=
(
Set
<
String
>)
ReflectionTestUtils
.
getField
(
jarScanFilter
,
"tldSkipSet"
);
assertThat
(
tldSkipSet
).
contains
(
"foo.jar"
,
"bar.jar"
);
assertThat
(
tldSkipSet
).
contains
(
"foo.jar"
,
"bar.jar"
);
}
}
...
...
spring-boot-samples/spring-boot-sample-tomcat/src/test/java/sample/tomcat/SampleTomcatApplicationTests.java
View file @
07462be0
...
@@ -17,7 +17,6 @@
...
@@ -17,7 +17,6 @@
package
sample
.
tomcat
;
package
sample
.
tomcat
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayInputStream
;
import
java.nio.charset.Charset
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.charset.StandardCharsets
;
import
java.util.zip.GZIPInputStream
;
import
java.util.zip.GZIPInputStream
;
...
...
spring-boot-samples/spring-boot-sample-undertow/src/test/java/sample/undertow/SampleUndertowApplicationTests.java
View file @
07462be0
...
@@ -17,7 +17,6 @@
...
@@ -17,7 +17,6 @@
package
sample
.
undertow
;
package
sample
.
undertow
;
import
java.io.ByteArrayInputStream
;
import
java.io.ByteArrayInputStream
;
import
java.nio.charset.Charset
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.charset.StandardCharsets
;
import
java.util.zip.GZIPInputStream
;
import
java.util.zip.GZIPInputStream
;
...
...
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