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
72dd3b56
Commit
72dd3b56
authored
Jan 11, 2021
by
Phillip Webb
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.2.x' into 2.3.x
Closes gh-24747
parents
7625a979
f9e3e0d5
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
117 additions
and
71 deletions
+117
-71
WebMvcAutoConfiguration.java
...ot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java
+109
-60
WelcomePageHandlerMapping.java
.../autoconfigure/web/servlet/WelcomePageHandlerMapping.java
+4
-5
WebMvcAutoConfigurationTests.java
...toconfigure/web/servlet/WebMvcAutoConfigurationTests.java
+2
-2
WelcomePageHandlerMappingTests.java
...configure/web/servlet/WelcomePageHandlerMappingTests.java
+2
-4
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java
View file @
72dd3b56
This diff is collapsed.
Click to expand it.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WelcomePageHandlerMapping.java
View file @
72dd3b56
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
21
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -18,7 +18,6 @@ package org.springframework.boot.autoconfigure.web.servlet;
...
@@ -18,7 +18,6 @@ package org.springframework.boot.autoconfigure.web.servlet;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Optional
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
...
@@ -49,9 +48,9 @@ final class WelcomePageHandlerMapping extends AbstractUrlHandlerMapping {
...
@@ -49,9 +48,9 @@ final class WelcomePageHandlerMapping extends AbstractUrlHandlerMapping {
private
static
final
List
<
MediaType
>
MEDIA_TYPES_ALL
=
Collections
.
singletonList
(
MediaType
.
ALL
);
private
static
final
List
<
MediaType
>
MEDIA_TYPES_ALL
=
Collections
.
singletonList
(
MediaType
.
ALL
);
WelcomePageHandlerMapping
(
TemplateAvailabilityProviders
templateAvailabilityProviders
,
WelcomePageHandlerMapping
(
TemplateAvailabilityProviders
templateAvailabilityProviders
,
ApplicationContext
applicationContext
,
Optional
<
Resource
>
welcomePage
,
String
staticPathPattern
)
{
ApplicationContext
applicationContext
,
Resource
welcomePage
,
String
staticPathPattern
)
{
if
(
welcomePage
.
isPresent
()
&&
"/**"
.
equals
(
staticPathPattern
))
{
if
(
welcomePage
!=
null
&&
"/**"
.
equals
(
staticPathPattern
))
{
logger
.
info
(
"Adding welcome page: "
+
welcomePage
.
get
()
);
logger
.
info
(
"Adding welcome page: "
+
welcomePage
);
setRootViewName
(
"forward:index.html"
);
setRootViewName
(
"forward:index.html"
);
}
}
else
if
(
welcomeTemplateExists
(
templateAvailabilityProviders
,
applicationContext
))
{
else
if
(
welcomeTemplateExists
(
templateAvailabilityProviders
,
applicationContext
))
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java
View file @
72dd3b56
/*
/*
* Copyright 2012-202
0
the original author or authors.
* Copyright 2012-202
1
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -913,7 +913,7 @@ class WebMvcAutoConfigurationTests {
...
@@ -913,7 +913,7 @@ class WebMvcAutoConfigurationTests {
protected
Map
<
String
,
List
<
Resource
>>
getResourceMappingLocations
(
ApplicationContext
context
)
{
protected
Map
<
String
,
List
<
Resource
>>
getResourceMappingLocations
(
ApplicationContext
context
)
{
Object
bean
=
context
.
getBean
(
"resourceHandlerMapping"
);
Object
bean
=
context
.
getBean
(
"resourceHandlerMapping"
);
if
(
bean
instanceof
HandlerMapping
)
{
if
(
bean
instanceof
HandlerMapping
)
{
return
getMappingLocations
(
context
.
getBean
(
"resourceHandlerMapping"
,
HandlerMapping
.
class
)
);
return
getMappingLocations
(
(
HandlerMapping
)
bean
);
}
}
assertThat
(
bean
.
toString
()).
isEqualTo
(
"null"
);
assertThat
(
bean
.
toString
()).
isEqualTo
(
"null"
);
return
Collections
.
emptyMap
();
return
Collections
.
emptyMap
();
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WelcomePageHandlerMappingTests.java
View file @
72dd3b56
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
21
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -18,7 +18,6 @@ package org.springframework.boot.autoconfigure.web.servlet;
...
@@ -18,7 +18,6 @@ package org.springframework.boot.autoconfigure.web.servlet;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Optional
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
...
@@ -162,8 +161,7 @@ class WelcomePageHandlerMappingTests {
...
@@ -162,8 +161,7 @@ class WelcomePageHandlerMappingTests {
return
new
WelcomePageHandlerMapping
(
return
new
WelcomePageHandlerMapping
(
templateAvailabilityProviders
templateAvailabilityProviders
.
getIfAvailable
(()
->
new
TemplateAvailabilityProviders
(
applicationContext
)),
.
getIfAvailable
(()
->
new
TemplateAvailabilityProviders
(
applicationContext
)),
applicationContext
,
Optional
.
ofNullable
(
staticIndexPage
.
getIfAvailable
()),
staticPathPattern
);
applicationContext
,
staticIndexPage
.
getIfAvailable
(),
staticPathPattern
);
}
}
}
}
...
...
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