본문 바로가기

WEB/Spring13

IoC, Dependency Injection Inversion of control(IoC) The approach of outsourcing the construction and management of objects Spring Container Primary fuctions Create and manage objects(Inversion of Control) Inject object dependencies(Dependency Injection) Dependency Injection The client delegates to another object the responsibility of providing its dependencies Injection types Constructor Injection Setter Injection Auto w.. 2024. 3. 12.
Spring Boot Dev Tools The problem When running Spring Boot applications, If you make changes to your source code, then you have to manually restart your application. Solution : Spring Boot Dev Tools Automatically restarts your application when code is updated 1. Adding the dependency to your POM file org.springframework.boot spring-boot-devtools 2. Preferences > Build, Execution, Deployment > Complier 3. Preferences .. 2024. 3. 9.
@SessionAttributes In Spring MVC, '@SessionAttributes' is an annotation used to declare session attributes at the controller level. It's used to specify model attributes that should be stored in the HTTP session between multiple requests handled by a specific controller. When you annotate a controller with '@sessionAttributes', you indicate which model attributes should be kept in the session and made available ac.. 2023. 12. 6.
final Keyword 1. Final Classes and Methods in Spring Components Just like in regular Java classes, you might encounter the use of 'final' in Spring components. For example, a class annotated with '@Service', '@Component', or '@Repository' might have final methods to prevent them from being overridden by subclasses. This is often used to ensure that certain behaviours provided by the Spring component remain co.. 2023. 12. 2.