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
31939138
Commit
31939138
authored
Mar 20, 2014
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
63de33ef
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
28 deletions
+29
-28
MessageSourceAutoConfiguration.java
...rk/boot/autoconfigure/MessageSourceAutoConfiguration.java
+7
-6
MessageSourceAutoConfigurationTests.java
...ot/autoconfigure/MessageSourceAutoConfigurationTests.java
+4
-4
index.adoc
spring-boot-docs/src/main/asciidoc/index.adoc
+1
-1
production-ready-features.adoc
...oot-docs/src/main/asciidoc/production-ready-features.adoc
+1
-1
endpoint.groovy
...r-shell/src/main/resources/commands/crash/endpoint.groovy
+2
-2
login.groovy
...rter-shell/src/main/resources/commands/crash/login.groovy
+14
-14
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/MessageSourceAutoConfiguration.java
View file @
31939138
/*
* Copyright 2012-201
3
the original author or authors.
* Copyright 2012-201
4
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -16,9 +16,6 @@
package
org
.
springframework
.
boot
.
autoconfigure
;
import
static
org
.
springframework
.
util
.
StringUtils
.
commaDelimitedListToStringArray
;
import
static
org
.
springframework
.
util
.
StringUtils
.
trimAllWhitespace
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean
;
import
org.springframework.boot.bind.RelaxedPropertyResolver
;
import
org.springframework.context.EnvironmentAware
;
...
...
@@ -31,9 +28,12 @@ import org.springframework.core.annotation.Order;
import
org.springframework.core.env.Environment
;
import
org.springframework.util.StringUtils
;
import
static
org
.
springframework
.
util
.
StringUtils
.
commaDelimitedListToStringArray
;
import
static
org
.
springframework
.
util
.
StringUtils
.
trimAllWhitespace
;
/**
* {@link EnableAutoConfiguration Auto-configuration} for {@link MessageSource}.
*
*
* @author Dave Syer
*/
@Configuration
...
...
@@ -53,7 +53,8 @@ public class MessageSourceAutoConfiguration implements EnvironmentAware {
ResourceBundleMessageSource
messageSource
=
new
ResourceBundleMessageSource
();
String
basename
=
this
.
environment
.
getProperty
(
"basename"
,
"messages"
);
if
(
StringUtils
.
hasText
(
basename
))
{
messageSource
.
setBasenames
(
commaDelimitedListToStringArray
(
trimAllWhitespace
(
basename
)));
messageSource
.
setBasenames
(
commaDelimitedListToStringArray
(
trimAllWhitespace
(
basename
)));
}
String
encoding
=
this
.
environment
.
getProperty
(
"encoding"
,
"utf-8"
);
messageSource
.
setDefaultEncoding
(
encoding
);
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/MessageSourceAutoConfigurationTests.java
View file @
31939138
/*
* Copyright 2012-201
3
the original author or authors.
* Copyright 2012-201
4
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -16,17 +16,17 @@
package
org
.
springframework
.
boot
.
autoconfigure
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
import
java.util.Locale
;
import
org.junit.Test
;
import
org.springframework.boot.test.EnvironmentTestUtils
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
import
static
org
.
junit
.
Assert
.
assertEquals
;
/**
* Tests for {@link MessageSourceAutoConfiguration}.
*
*
* @author Dave Syer
*/
public
class
MessageSourceAutoConfigurationTests
{
...
...
spring-boot-docs/src/main/asciidoc/index.adoc
View file @
31939138
= Spring Boot Reference Guide
Phillip Webb; Dave Syer; Josh Long;
Phillip Webb; Dave Syer; Josh Long;
Stéphane Nicoll;
:doctype: book
:toc:
:toclevels: 4
...
...
spring-boot-docs/src/main/asciidoc/production-ready-features.adoc
View file @
31939138
...
...
@@ -468,7 +468,7 @@ download and install http://www.putty.org/[PuTTY].
----
Type
`
help
`
for
a
list
of
commands
.
Spring
boot
provides
`
metrics
`,
`
beans
`,
`
autoconfig
`
and
`
endpoint
`
commands
.
and
`
endpoint
`
commands
.
...
...
spring-boot-starters/spring-boot-starter-shell/src/main/resources/commands/crash/endpoint.groovy
View file @
31939138
...
...
@@ -24,8 +24,8 @@ class endpoint {
// Don't require passed argument to end with 'Endpoint'
if
(!
name
.
endsWith
(
"Endpoint"
))
{
name
=
name
+
"Endpoint"
}
name
=
name
+
"Endpoint"
}
context
.
attributes
[
'spring.beanfactory'
].
getBeansOfType
(
Endpoint
.
class
).
each
{
n
,
endpoint
->
if
(
n
.
equals
(
name
)
&&
endpoint
.
isEnabled
())
{
...
...
spring-boot-starters/spring-boot-starter-shell/src/main/resources/commands/crash/login.groovy
View file @
31939138
welcome
=
{
->
if
(!
crash
.
context
.
attributes
[
'spring.environment'
].
getProperty
(
"spring.main.show_banner"
,
Boolean
.
class
,
Boolean
.
TRUE
))
{
return
""
}
if
(!
crash
.
context
.
attributes
[
'spring.environment'
].
getProperty
(
"spring.main.show_banner"
,
Boolean
.
class
,
Boolean
.
TRUE
))
{
return
""
}
// Resolve hostname
def
hostName
;
try
{
hostName
=
java
.
net
.
InetAddress
.
getLocalHost
().
getHostName
();
}
catch
(
java
.
net
.
UnknownHostException
ignore
)
{
hostName
=
"localhost"
;
}
// Resolve hostname
def
hostName
;
try
{
hostName
=
java
.
net
.
InetAddress
.
getLocalHost
().
getHostName
();
}
catch
(
java
.
net
.
UnknownHostException
ignore
)
{
hostName
=
"localhost"
;
}
//
Get Spring Boot version from context
def
version
=
crash
.
context
.
attributes
.
get
(
"spring.boot.version"
)
Get
Spring
Boot
version
from
context
def
version
=
crash
.
context
.
attributes
.
get
(
"spring.boot.version"
)
return
"""\
return
"""\
. ____ _ __ _ _
/\\\\ / ___'_ __ _ _(_)_ __ __ _ \\ \\ \\ \\
( ( )\\___ | '_ | '_| | '_ \\/ _` | \\ \\ \\ \\
...
...
@@ -26,5 +26,5 @@ welcome = { ->
}
prompt
=
{
->
return
"> "
;
return
"> "
;
}
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