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
9b153890
Commit
9b153890
authored
Jul 25, 2017
by
Johnny Lim
Committed by
Stephane Nicoll
Jul 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
Closes gh-9855
parent
75fc0c38
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
10 deletions
+10
-10
howto.adoc
spring-boot-docs/src/main/asciidoc/howto.adoc
+3
-3
SpringApplication.java
...main/java/org/springframework/boot/SpringApplication.java
+2
-2
SpringApplicationBuilder.java
...pringframework/boot/builder/SpringApplicationBuilder.java
+3
-3
AbstractServletWebServerFactoryTests.java
.../servlet/server/AbstractServletWebServerFactoryTests.java
+2
-2
No files found.
spring-boot-docs/src/main/asciidoc/howto.adoc
View file @
9b153890
...
@@ -1519,7 +1519,7 @@ There is a catch however. Because the actual type of the connection pool is not
...
@@ -1519,7 +1519,7 @@ There is a catch however. Because the actual type of the connection pool is not
no keys are generated in the metadata for your custom `DataSource` and no completion is
no keys are generated in the metadata for your custom `DataSource` and no completion is
available in your IDE (The `DataSource` interface doesn't expose any property). Also, if
available in your IDE (The `DataSource` interface doesn't expose any property). Also, if
you happen to have Hikari on the classpath, this basic setup will not work because Hikari
you happen to have Hikari on the classpath, this basic setup will not work because Hikari
has no `url` p
arameter (but a `jdbcUrl` parameter
). You will have to rewrite your
has no `url` p
roperty (but a `jdbcUrl` property
). You will have to rewrite your
configuration as follows:
configuration as follows:
[source,properties,indent=0]
[source,properties,indent=0]
...
@@ -1585,7 +1585,7 @@ described in the previous section. You must, however, mark one of the `DataSourc
...
@@ -1585,7 +1585,7 @@ described in the previous section. You must, however, mark one of the `DataSourc
type.
type.
If you create your own `DataSource`, the auto-configuration will back off. In the example
If you create your own `DataSource`, the auto-configuration will back off. In the example
below, we provide the _exact_ same features set
than
what the auto-configuration provides
below, we provide the _exact_ same features set
as
what the auto-configuration provides
on the primary data source:
on the primary data source:
[source,java,indent=0,subs="verbatim,quotes,attributes"]
[source,java,indent=0,subs="verbatim,quotes,attributes"]
...
@@ -1618,7 +1618,7 @@ include::{code-examples}/jdbc/CompleteTwoDataSourcesExample.java[tag=configurati
...
@@ -1618,7 +1618,7 @@ include::{code-examples}/jdbc/CompleteTwoDataSourcesExample.java[tag=configurati
----
----
This final example configures two data sources on custom namespaces with the same logic
This final example configures two data sources on custom namespaces with the same logic
than
what Spring Boot would do in auto-configuration.
as
what Spring Boot would do in auto-configuration.
...
...
spring-boot/src/main/java/org/springframework/boot/SpringApplication.java
View file @
9b153890
...
@@ -262,14 +262,14 @@ public class SpringApplication {
...
@@ -262,14 +262,14 @@ public class SpringApplication {
this
.
resourceLoader
=
resourceLoader
;
this
.
resourceLoader
=
resourceLoader
;
Assert
.
notNull
(
primarySources
,
"PrimarySources must not be null"
);
Assert
.
notNull
(
primarySources
,
"PrimarySources must not be null"
);
this
.
primarySources
=
new
LinkedHashSet
<>(
Arrays
.
asList
(
primarySources
));
this
.
primarySources
=
new
LinkedHashSet
<>(
Arrays
.
asList
(
primarySources
));
this
.
webApplicationType
=
deduceWebApplication
();
this
.
webApplicationType
=
deduceWebApplication
Type
();
setInitializers
((
Collection
)
getSpringFactoriesInstances
(
setInitializers
((
Collection
)
getSpringFactoriesInstances
(
ApplicationContextInitializer
.
class
));
ApplicationContextInitializer
.
class
));
setListeners
((
Collection
)
getSpringFactoriesInstances
(
ApplicationListener
.
class
));
setListeners
((
Collection
)
getSpringFactoriesInstances
(
ApplicationListener
.
class
));
this
.
mainApplicationClass
=
deduceMainApplicationClass
();
this
.
mainApplicationClass
=
deduceMainApplicationClass
();
}
}
private
WebApplicationType
deduceWebApplication
()
{
private
WebApplicationType
deduceWebApplication
Type
()
{
if
(
ClassUtils
.
isPresent
(
REACTIVE_WEB_ENVIRONMENT_CLASS
,
null
)
if
(
ClassUtils
.
isPresent
(
REACTIVE_WEB_ENVIRONMENT_CLASS
,
null
)
&&
!
ClassUtils
.
isPresent
(
MVC_WEB_ENVIRONMENT_CLASS
,
null
))
{
&&
!
ClassUtils
.
isPresent
(
MVC_WEB_ENVIRONMENT_CLASS
,
null
))
{
return
WebApplicationType
.
REACTIVE
;
return
WebApplicationType
.
REACTIVE
;
...
...
spring-boot/src/main/java/org/springframework/boot/builder/SpringApplicationBuilder.java
View file @
9b153890
...
@@ -302,12 +302,12 @@ public class SpringApplicationBuilder {
...
@@ -302,12 +302,12 @@ public class SpringApplicationBuilder {
/**
/**
* Flag to explicitly request a specific type of web application. Auto-detected based
* Flag to explicitly request a specific type of web application. Auto-detected based
* on the classpath if not set.
* on the classpath if not set.
* @param webApplication the type of web application
* @param webApplication
Type
the type of web application
* @return the current builder
* @return the current builder
* @since 2.0.0
* @since 2.0.0
*/
*/
public
SpringApplicationBuilder
web
(
WebApplicationType
webApplication
)
{
public
SpringApplicationBuilder
web
(
WebApplicationType
webApplication
Type
)
{
this
.
application
.
setWebApplicationType
(
webApplication
);
this
.
application
.
setWebApplicationType
(
webApplication
Type
);
return
this
;
return
this
;
}
}
...
...
spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java
View file @
9b153890
...
@@ -763,12 +763,12 @@ public abstract class AbstractServletWebServerFactoryTests {
...
@@ -763,12 +763,12 @@ public abstract class AbstractServletWebServerFactoryTests {
}
}
@Test
@Test
public
void
compressionOfResposeToGetRequest
()
throws
Exception
{
public
void
compressionOfRespo
n
seToGetRequest
()
throws
Exception
{
assertThat
(
doTestCompression
(
10000
,
null
,
null
)).
isTrue
();
assertThat
(
doTestCompression
(
10000
,
null
,
null
)).
isTrue
();
}
}
@Test
@Test
public
void
compressionOfResposeToPostRequest
()
throws
Exception
{
public
void
compressionOfRespo
n
seToPostRequest
()
throws
Exception
{
assertThat
(
doTestCompression
(
10000
,
null
,
null
,
HttpMethod
.
POST
)).
isTrue
();
assertThat
(
doTestCompression
(
10000
,
null
,
null
,
HttpMethod
.
POST
)).
isTrue
();
}
}
...
...
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