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
5157a751
Commit
5157a751
authored
May 13, 2020
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
7b790299
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
10 deletions
+7
-10
CompositeHandlerExceptionResolver.java
...figure/web/servlet/CompositeHandlerExceptionResolver.java
+6
-9
WebMvcEndpointChildContextConfigurationIntegrationTests.java
...MvcEndpointChildContextConfigurationIntegrationTests.java
+1
-1
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/CompositeHandlerExceptionResolver.java
View file @
5157a751
...
@@ -19,7 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.web.servlet;
...
@@ -19,7 +19,6 @@ package org.springframework.boot.actuate.autoconfigure.web.servlet;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Objects
;
import
java.util.Optional
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
...
@@ -52,15 +51,13 @@ class CompositeHandlerExceptionResolver implements HandlerExceptionResolver {
...
@@ -52,15 +51,13 @@ class CompositeHandlerExceptionResolver implements HandlerExceptionResolver {
if
(
this
.
resolvers
==
null
)
{
if
(
this
.
resolvers
==
null
)
{
this
.
resolvers
=
extractResolvers
();
this
.
resolvers
=
extractResolvers
();
}
}
Optional
<
ModelAndView
>
modelAndView
=
this
.
resolvers
.
stream
()
ModelAndView
resolved
=
this
.
resolvers
.
stream
()
.
map
((
resolver
)
->
resolver
.
resolveException
(
request
,
response
,
handler
,
ex
)).
filter
(
Objects:
:
nonNull
)
.
map
((
resolver
)
->
resolver
.
resolveException
(
request
,
response
,
handler
,
ex
)).
filter
(
Objects:
:
nonNull
)
.
findFirst
();
.
findFirst
().
orElse
(
null
);
modelAndView
.
ifPresent
((
mav
)
->
{
if
(
resolved
!=
null
&&
resolved
.
isEmpty
())
{
if
(
mav
.
isEmpty
())
{
request
.
setAttribute
(
"javax.servlet.error.exception"
,
ex
);
request
.
setAttribute
(
"javax.servlet.error.exception"
,
ex
);
}
}
});
return
resolved
;
return
modelAndView
.
orElse
(
null
);
}
}
private
List
<
HandlerExceptionResolver
>
extractResolvers
()
{
private
List
<
HandlerExceptionResolver
>
extractResolvers
()
{
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfigurationIntegrationTests.java
View file @
5157a751
...
@@ -120,7 +120,7 @@ class WebMvcEndpointChildContextConfigurationIntegrationTests {
...
@@ -120,7 +120,7 @@ class WebMvcEndpointChildContextConfigurationIntegrationTests {
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
private
Map
<
String
,
?>
getResponseBody
(
ClientResponse
response
)
{
private
Map
<
String
,
?>
getResponseBody
(
ClientResponse
response
)
{
return
(
Map
<
String
,
?>)
response
.
bodyToMono
(
Map
.
class
).
block
();
return
response
.
bodyToMono
(
Map
.
class
).
block
();
}
}
@Endpoint
(
id
=
"fail"
)
@Endpoint
(
id
=
"fail"
)
...
...
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