0
0
Spring Bootframework~10 mins

application.yml alternative in Spring Boot - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the alternative properties file in Spring Boot.

Spring Boot
spring.config.name=[1]
Drag options to blanks, or click blank then click option'
Aconfig
Bapplication
Csettings
Dproperties
Attempts:
3 left
💡 Hint
Common Mistakes
Using the full file name including extension instead of just the base name.
Trying to set the file path instead of the config name.
2fill in blank
medium

Complete the code to load an alternative properties file from a specific location.

Spring Boot
spring.config.location=[1]
Drag options to blanks, or click blank then click option'
Aclasspath:/config/
Bclasspath:/application/
Chttp://configserver/
Dfile:./config/
Attempts:
3 left
💡 Hint
Common Mistakes
Using classpath: when the file is outside the classpath.
Omitting the prefix and causing Spring Boot to not find the file.
3fill in blank
hard

Fix the error in the command to run Spring Boot with an alternative config file.

Spring Boot
java -jar app.jar --spring.config.name=[1]
Drag options to blanks, or click blank then click option'
Aconfig
Bapplication.yml
Capplication
Dconfig.yml
Attempts:
3 left
💡 Hint
Common Mistakes
Including the file extension in the config name.
Using the default name when trying to override.
4fill in blank
hard

Fill both blanks to specify multiple config locations in Spring Boot.

Spring Boot
spring.config.location=[1],[2]
Drag options to blanks, or click blank then click option'
Aclasspath:/custom/
Bfile:./config/
Cclasspath:/default/
Dfile:/etc/config/
Attempts:
3 left
💡 Hint
Common Mistakes
Using classpath locations when files are outside the classpath.
Not separating locations with commas.
5fill in blank
hard

Fill all three blanks to set an alternative config file name, location, and profile.

Spring Boot
java -jar app.jar --spring.config.name=[1] --spring.config.location=[2] --spring.profiles.active=[3]
Drag options to blanks, or click blank then click option'
Acustomconfig
Bfile:./custom/
Cdev
Dapplication
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up config name and location values.
Forgetting to activate the profile.