File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed
java/guru/springframework/bootstrap/profilesysout Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
package guru .springframework .bootstrap .profilesysout ;
2
2
3
+ import org .springframework .beans .factory .annotation .Autowired ;
4
+ import org .springframework .beans .factory .annotation .Value ;
3
5
import org .springframework .context .annotation .Profile ;
4
6
import org .springframework .stereotype .Component ;
5
7
10
12
@ Profile ("default" )
11
13
public class DefaultProfileSysOut {
12
14
13
- public DefaultProfileSysOut () {
15
+ @ Autowired
16
+ public DefaultProfileSysOut (@ Value ("${guru.springframework.profile.message}" ) String msg ) {
14
17
System .out .println ("##################################" );
15
18
System .out .println ("##################################" );
16
19
System .out .println ("## DEFAULT ##" );
20
+ System .out .println (msg );
17
21
System .out .println ("##################################" );
18
22
System .out .println ("##################################" );
19
23
}
Original file line number Diff line number Diff line change
1
+ guru.springframework.profile.message =This is a default profile
Original file line number Diff line number Diff line change @@ -5,4 +5,4 @@ guru.jms.port=3330
5
5
guru.jms.user =Ron
6
6
guru.jms.password =Burgundy
7
7
8
- spring.profiles.active =dev
8
+ # spring.profiles.active=dev
You can’t perform that action at this time.
0 commit comments