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
bfe4240e
Commit
bfe4240e
authored
Jun 20, 2014
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
445589a5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
DataSourceInitializer.java
...mework/boot/autoconfigure/jdbc/DataSourceInitializer.java
+2
-2
ErrorPageFilter.java
...org/springframework/boot/context/web/ErrorPageFilter.java
+13
-9
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceInitializer.java
View file @
bfe4240e
...
...
@@ -79,9 +79,9 @@ class DataSourceInitializer implements ApplicationListener<DataSourceInitialized
this
.
applicationContext
.
publishEvent
(
new
DataSourceInitializedEvent
(
this
.
dataSource
));
}
catch
(
IllegalStateException
e
)
{
catch
(
IllegalStateException
e
x
)
{
logger
.
warn
(
"Could not send event to complete DataSource initialization ("
+
e
.
getMessage
()
+
")"
);
+
e
x
.
getMessage
()
+
")"
);
}
}
}
...
...
spring-boot/src/main/java/org/springframework/boot/context/web/ErrorPageFilter.java
View file @
bfe4240e
...
...
@@ -136,18 +136,22 @@ class ErrorPageFilter extends AbstractConfigurableEmbeddedServletContainer imple
request
.
setAttribute
(
ERROR_EXCEPTION
,
ex
);
request
.
setAttribute
(
ERROR_EXCEPTION_TYPE
,
type
.
getName
());
wrapped
.
sendError
(
500
,
ex
.
getMessage
());
if
(!
wrapped
.
isCommitted
())
{
wrapped
.
reset
();
request
.
getRequestDispatcher
(
errorPath
).
forward
(
request
,
wrapped
);
}
else
{
String
message
=
"Cannot forward to error page for"
+
request
.
getRequestURI
()
+
" (response is committed), so this response may have
the wrong status code"
;
logger
.
error
(
message
)
;
forwardToErrorPage
(
errorPath
,
request
,
wrapped
);
}
private
void
forwardToErrorPage
(
String
path
,
HttpServletRequest
request
,
ServletResponse
response
)
throws
ServletException
,
IOException
{
if
(!
response
.
isCommitted
())
{
String
message
=
"Cannot forward to error page for"
+
request
.
getRequestURI
()
+
" (response is committed), so this response may have
"
+
"the wrong status code"
;
// User might see the error page without all the data here but the exception
// isn't going to help anyone (and it's already been logged)
logger
.
error
(
message
);
return
;
}
response
.
reset
();
request
.
getRequestDispatcher
(
path
).
forward
(
request
,
response
);
}
private
String
getErrorPath
(
Map
<
Integer
,
String
>
map
,
Integer
status
)
{
...
...
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