Application Properties & YAML
Configuration with application.properties/yml, @Value, @ConfigurationProperties, profiles, external properties
1What is the main difference between application.properties and application.yml in Spring Boot?
What is the main difference between application.properties and application.yml in Spring Boot?
Cevap
Both files are used to configure Spring Boot, but use different formats. YAML format (.yml) allows hierarchical structure with indentation, making it more readable for complex configurations. Properties format (.properties) uses flat key=value syntax. Spring Boot automatically loads either one, with priority to .properties if both exist.
2Which property allows changing the embedded server port in Spring Boot?
Which property allows changing the embedded server port in Spring Boot?
Cevap
The server.port property configures the HTTP port of the embedded server (Tomcat, Jetty, Undertow). By default, Spring Boot starts on port 8080. This property can be defined in application.properties (server.port=9000) or in YAML (server: port: 9000). It can also be overridden via JVM argument (-Dserver.port=9000) or environment variable.
3How to declare the property spring.datasource.url in YAML for a local PostgreSQL database?
How to declare the property spring.datasource.url in YAML for a local PostgreSQL database?
Cevap
In YAML, hierarchical properties use indentation (spaces, not tabs). The property spring.datasource.url breaks down into spring → datasource → url. Each level is indented by 2 spaces. This hierarchical structure makes configuration more readable than the flat properties version (spring.datasource.url=jdbc:postgresql://localhost:5432/mydb).
How to activate the 'dev' profile at startup of a Spring Boot application?
Which annotation allows injecting a configuration property into a Spring bean?
+13 mülakat soruları
Diğer Spring Boot mülakat konuları
Spring Core - IoC & DI
Spring Boot Auto-Configuration
Spring Boot Starters
Logging with SLF4J & Logback
Spring Boot DevTools
Spring MVC Basics
Spring REST Controllers
Request & Response Handling
Exception Handling
Bean Validation
Spring Data JPA Basics
JPA Entities & Relationships
JPA Queries
Spring Data Repositories
Spring Security Basics
Spring Boot Actuator
Unit Testing with JUnit & Mockito
Spring Boot Testing
Profiles & Environment
RestTemplate & WebClient
Async & Scheduling
Caching with Spring
Spring WebFlux (Reactive)
Spring Transactions
Advanced Authentication & Authorization
JWT & Stateless Security
OAuth2 & Authorization Server
Spring Boot & Docker
Microservices with Spring
Spring Cloud Config
Performance Optimization
GraalVM Native Images
Bir sonraki mülakatın için Spring Boot'de uzmanlaş
Tüm sorulara, flashcards'a, teknik testlere, code review alıştırmalarına ve mülakat simülatörlerine eriş.
Ücretsiz başla