0% found this document useful (0 votes)
2 views3 pages

SpringBoot_Quick_Notes (1)

Spring Boot is a framework designed for rapid development of Java-based web applications, offering features like auto-configuration and embedded servers. Key components include important annotations for REST APIs, a structured project layout, and starter dependencies for various functionalities. Advantages of Spring Boot include fast development, easy configuration, and production-ready features.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

SpringBoot_Quick_Notes (1)

Spring Boot is a framework designed for rapid development of Java-based web applications, offering features like auto-configuration and embedded servers. Key components include important annotations for REST APIs, a structured project layout, and starter dependencies for various functionalities. Advantages of Spring Boot include fast development, easy configuration, and production-ready features.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Spring Boot Quick Revision Notes

What is Spring Boot?

- Spring Boot is a framework to build Java-based web applications quickly.

- It simplifies Spring framework by providing auto-configuration and embedded servers.

Key Features:

- Auto Configuration

- Embedded Servers (like Tomcat)

- No need for XML configuration

- Spring Boot Starter Dependencies

- Spring Boot Actuator for monitoring

- Spring Boot DevTools for fast development

Important Annotations:

- @SpringBootApplication: Main class annotation (includes @Configuration,

@EnableAutoConfiguration, @ComponentScan)

- @RestController: Marks class as a REST API controller

- @RequestMapping / @GetMapping / @PostMapping: Maps HTTP requests

- @Autowired: Injects beans automatically

- @Service, @Repository, @Component: Marks classes for Spring to manage

Spring Boot Project Structure:

- Controller: Handles HTTP requests

- Service: Business logic

- Repository: Database access layer


Spring Boot Starter Dependencies:

- spring-boot-starter-web: For REST APIs and MVC

- spring-boot-starter-data-jpa: For database with Hibernate

- spring-boot-starter-security: For authentication

- spring-boot-starter-test: For testing

Spring Boot with Database:

- Use application.properties to configure DB:

spring.datasource.url=...

spring.datasource.username=...

spring.datasource.password=...

spring.jpa.hibernate.ddl-auto=update

Common Interview Questions:

1. What is Spring Boot?

- A simplified framework for Spring apps with less configuration.

2. Difference between Spring and Spring Boot?

- Spring needs XML config, server setup. Spring Boot handles everything automatically.

3. What is @SpringBootApplication?

- Combines @Configuration, @EnableAutoConfiguration, and @ComponentScan.

4. What is the use of application.properties?

- To configure server, database, and other settings.


5. What is dependency injection?

- Automatically providing required objects to a class using @Autowired.

6. How to connect Spring Boot with database?

- Use JPA and set DB configs in application.properties

7. What is embedded server?

- A built-in server (Tomcat) that runs the app directly (no need to deploy WAR).

Advantages of Spring Boot:

- Fast development

- Easy configuration

- Production-ready features

- Easy integration with databases

You might also like