0
0
Spring Bootframework~10 mins

application.properties structure 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 set the server port to 8080 in application.properties.

Spring Boot
server.[1]=8080
Drag options to blanks, or click blank then click option'
Aport
Bhost
Caddress
Durl
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'host' instead of 'port' will not set the port number.
Using 'address' or 'url' are incorrect keys for port configuration.
2fill in blank
medium

Complete the code to set the Spring datasource URL in application.properties.

Spring Boot
spring.datasource.[1]=jdbc:mysql://localhost:3306/mydb
Drag options to blanks, or click blank then click option'
Adriver-class-name
Bpassword
Cusername
Durl
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'username' or 'password' instead of 'url' will not set the connection string.
Using 'driver-class-name' is for specifying the driver, not the URL.
3fill in blank
hard

Fix the error in the property key to set the logging level for Spring framework.

Spring Boot
logging.level.[1]=DEBUG
Drag options to blanks, or click blank then click option'
Aspring-framework
Bspring_framework
Corg.springframework
DspringFramework
Attempts:
3 left
💡 Hint
Common Mistakes
Using hyphens or underscores breaks the property key format.
Capital letters are not used in property keys.
4fill in blank
hard

Fill both blanks to configure the Thymeleaf template prefix and suffix in application.properties.

Spring Boot
spring.thymeleaf.[1]=classpath:/templates/
spring.thymeleaf.[2]=.html
Drag options to blanks, or click blank then click option'
Aprefix
Bsuffix
Cpath
Dextension
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'path' or 'extension' are not valid property keys for Thymeleaf configuration.
Mixing prefix and suffix values will cause template loading errors.
5fill in blank
hard

Fill all three blanks to configure a custom error page path and enable detailed error messages.

Spring Boot
server.error.[1]=/error
server.error.[2]=true
server.error.[3]=true
Drag options to blanks, or click blank then click option'
Apath
Binclude-message
Cinclude-stacktrace
Denabled
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'enabled' instead of 'include-message' or 'include-stacktrace' will not work.
Not setting the error path will use the default error page.