0
0
Spring Bootframework~10 mins

Application.properties basics 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 'server.host' instead of 'server.port'
Using 'server.address' which is for IP binding
2fill in blank
medium

Complete the code to set the application name to 'MyApp' in application.properties.

Spring Boot
spring.application.[1]=MyApp
Drag options to blanks, or click blank then click option'
Aname
Bversion
Cid
Dtitle
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'spring.application.version' which is for version info
Using 'spring.application.id' which is not standard
3fill in blank
hard

Fix the error in the property key to enable debug logging for Spring MVC.

Spring Boot
logging.level.[1]=DEBUG
Drag options to blanks, or click blank then click option'
Aspringframework.web
Borg.springframework.webmvc
Cspringframework
Dspringframework.webmvc.mvc
Attempts:
3 left
💡 Hint
Common Mistakes
Using too broad package like 'springframework'
Adding extra segments like 'mvc' twice
4fill in blank
hard

Fill both blanks to configure a datasource URL and username in application.properties.

Spring Boot
spring.datasource.[1]=jdbc:mysql://localhost:3306/mydb
spring.datasource.[2]=user123
Drag options to blanks, or click blank then click option'
Aurl
Bpassword
Cusername
Ddriver-class-name
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'password' instead of 'username' for the second blank
Using 'driver-class-name' for URL
5fill in blank
hard

Fill all three blanks to set server port, context path, and enable HTTPS in application.properties.

Spring Boot
server.[1]=8443
server.servlet.[2]=/app
server.ssl.[3]=true
Drag options to blanks, or click blank then click option'
Aport
Bcontext-path
Cenabled
Daddress
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'address' instead of 'port'
Using 'contextPath' instead of 'context-path'
Using 'enable' instead of 'enabled'