Bird
0
0

Which property key is used to set the context path of a Spring Boot application in application.properties?

easy📝 Conceptual Q2 of 15
Spring Boot - Fundamentals
Which property key is used to set the context path of a Spring Boot application in application.properties?
Aspring.application.context
Bspring.context.path
Cserver.context-path
Dserver.servlet.context-path
Step-by-Step Solution
Solution:
  1. Step 1: Recall the property for context path in Spring Boot

    Spring Boot uses server.servlet.context-path to set the base URL path.
  2. Step 2: Compare options with official property names

    Only server.servlet.context-path matches the correct naming convention.
  3. Final Answer:

    Use server.servlet.context-path to set context path -> Option D
  4. Quick Check:

    Context path property = server.servlet.context-path [OK]
Quick Trick: Context path uses server.servlet.context-path [OK]
Common Mistakes:
  • Using deprecated server.context-path
  • Confusing spring.* prefix
  • Mixing application and server prefixes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes