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
7e3cb50a
Commit
7e3cb50a
authored
Aug 20, 2013
by
Phillip Webb
Committed by
Phillip Webb
Sep 06, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
021fe45d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
26 deletions
+24
-26
EmbeddedDatabaseConfiguration.java
...oot/autoconfigure/jdbc/EmbeddedDatabaseConfiguration.java
+15
-18
WebMvcAutoConfiguration.java
...ework/boot/autoconfigure/web/WebMvcAutoConfiguration.java
+9
-8
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/EmbeddedDatabaseConfiguration.java
View file @
7e3cb50a
...
@@ -39,28 +39,25 @@ import org.springframework.util.ClassUtils;
...
@@ -39,28 +39,25 @@ import org.springframework.util.ClassUtils;
public
class
EmbeddedDatabaseConfiguration
{
public
class
EmbeddedDatabaseConfiguration
{
private
static
final
Map
<
EmbeddedDatabaseType
,
String
>
EMBEDDED_DATABASE_DRIVER_CLASSES
;
private
static
final
Map
<
EmbeddedDatabaseType
,
String
>
EMBEDDED_DATABASE_DRIVER_CLASSES
;
private
static
final
Map
<
EmbeddedDatabaseType
,
String
>
EMBEDDED_DATABASE_URLS
;
private
EmbeddedDatabase
database
;
static
{
static
{
Map
<
EmbeddedDatabaseType
,
String
>
drivers
=
new
LinkedHashMap
<
EmbeddedDatabaseType
,
String
>();
drivers
.
put
(
EmbeddedDatabaseType
.
H2
,
"org.h2.Driver"
);
drivers
.
put
(
EmbeddedDatabaseType
.
DERBY
,
"org.apache.derby.jdbc.EmbeddedDriver"
);
drivers
.
put
(
EmbeddedDatabaseType
.
HSQL
,
"org.hsqldb.jdbcDriver"
);
EMBEDDED_DATABASE_DRIVER_CLASSES
=
drivers
;
}
EMBEDDED_DATABASE_DRIVER_CLASSES
=
new
LinkedHashMap
<
EmbeddedDatabaseType
,
String
>();
private
static
final
Map
<
EmbeddedDatabaseType
,
String
>
EMBEDDED_DATABASE_URLS
;
EMBEDDED_DATABASE_DRIVER_CLASSES
.
put
(
EmbeddedDatabaseType
.
H2
,
"org.h2.Driver"
);
static
{
EMBEDDED_DATABASE_DRIVER_CLASSES
.
put
(
EmbeddedDatabaseType
.
DERBY
,
Map
<
EmbeddedDatabaseType
,
String
>
urls
=
new
LinkedHashMap
<
EmbeddedDatabaseType
,
String
>();
"org.apache.derby.jdbc.EmbeddedDriver"
);
urls
.
put
(
EmbeddedDatabaseType
.
H2
,
"jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1"
);
EMBEDDED_DATABASE_DRIVER_CLASSES
.
put
(
EmbeddedDatabaseType
.
HSQL
,
urls
.
put
(
EmbeddedDatabaseType
.
DERBY
,
"jdbc:derby:memory:testdb;create=true"
);
"org.hsqldb.jdbcDriver"
);
urls
.
put
(
EmbeddedDatabaseType
.
HSQL
,
"jdbc:hsqldb:mem:testdb"
);
EMBEDDED_DATABASE_URLS
=
urls
;
EMBEDDED_DATABASE_URLS
=
new
LinkedHashMap
<
EmbeddedDatabaseType
,
String
>();
EMBEDDED_DATABASE_URLS
.
put
(
EmbeddedDatabaseType
.
H2
,
"jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1"
);
EMBEDDED_DATABASE_URLS
.
put
(
EmbeddedDatabaseType
.
DERBY
,
"jdbc:derby:memory:testdb;create=true"
);
EMBEDDED_DATABASE_URLS
.
put
(
EmbeddedDatabaseType
.
HSQL
,
"jdbc:hsqldb:mem:testdb"
);
}
}
private
EmbeddedDatabase
database
;
@Bean
@Bean
public
DataSource
dataSource
()
{
public
DataSource
dataSource
()
{
EmbeddedDatabaseBuilder
builder
=
new
EmbeddedDatabaseBuilder
()
EmbeddedDatabaseBuilder
builder
=
new
EmbeddedDatabaseBuilder
()
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration.java
View file @
7e3cb50a
...
@@ -98,6 +98,12 @@ public class WebMvcAutoConfiguration {
...
@@ -98,6 +98,12 @@ public class WebMvcAutoConfiguration {
}
}
}
}
@Bean
@ConditionalOnMissingBean
(
HiddenHttpMethodFilter
.
class
)
public
HiddenHttpMethodFilter
hiddenHttpMethodFilter
()
{
return
new
HiddenHttpMethodFilter
();
}
// Defined as a nested config to ensure WebMvcConfigurerAdapter it not read when not
// Defined as a nested config to ensure WebMvcConfigurerAdapter it not read when not
// on the classpath
// on the classpath
@EnableWebMvc
@EnableWebMvc
...
@@ -111,24 +117,24 @@ public class WebMvcAutoConfiguration {
...
@@ -111,24 +117,24 @@ public class WebMvcAutoConfiguration {
@Autowired
@Autowired
private
ResourceLoader
resourceLoader
;
private
ResourceLoader
resourceLoader
;
@Bean
@ConditionalOnBean
(
View
.
class
)
@ConditionalOnBean
(
View
.
class
)
@ConditionalOnMissingBean
(
InternalResourceViewResolver
.
class
)
@ConditionalOnMissingBean
(
InternalResourceViewResolver
.
class
)
@Bean
public
InternalResourceViewResolver
defaultViewResolver
()
{
public
InternalResourceViewResolver
defaultViewResolver
()
{
InternalResourceViewResolver
resolver
=
new
InternalResourceViewResolver
();
InternalResourceViewResolver
resolver
=
new
InternalResourceViewResolver
();
return
resolver
;
return
resolver
;
}
}
@ConditionalOnBean
(
View
.
class
)
@Bean
@Bean
@ConditionalOnBean
(
View
.
class
)
public
BeanNameViewResolver
beanNameViewResolver
()
{
public
BeanNameViewResolver
beanNameViewResolver
()
{
BeanNameViewResolver
resolver
=
new
BeanNameViewResolver
();
BeanNameViewResolver
resolver
=
new
BeanNameViewResolver
();
resolver
.
setOrder
(
0
);
resolver
.
setOrder
(
0
);
return
resolver
;
return
resolver
;
}
}
@ConditionalOnBean
(
View
.
class
)
@Bean
@Bean
@ConditionalOnBean
(
View
.
class
)
public
ContentNegotiatingViewResolver
viewResolver
(
BeanFactory
beanFactory
)
{
public
ContentNegotiatingViewResolver
viewResolver
(
BeanFactory
beanFactory
)
{
ContentNegotiatingViewResolver
resolver
=
new
ContentNegotiatingViewResolver
();
ContentNegotiatingViewResolver
resolver
=
new
ContentNegotiatingViewResolver
();
resolver
.
setContentNegotiationManager
(
beanFactory
resolver
.
setContentNegotiationManager
(
beanFactory
...
@@ -211,12 +217,7 @@ public class WebMvcAutoConfiguration {
...
@@ -211,12 +217,7 @@ public class WebMvcAutoConfiguration {
return
requestHandler
;
return
requestHandler
;
}
}
}
}
}
@Bean
@ConditionalOnMissingBean
(
HiddenHttpMethodFilter
.
class
)
public
HiddenHttpMethodFilter
hiddenHttpMethodFilter
()
{
return
new
HiddenHttpMethodFilter
();
}
}
}
}
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