SPRING CORE / CATATAN</>↗Spring Core11 Jul 2025
In Spring, you can programmatically register beans into the application context at runtime using the BeanDefinitionRegistry or ConfigurableApplicationContext. Below are different approaches depending on your use case: 1. Using BeanDefinitionRegistry The BeanDefinitionRegistry interface can be used to dynamically register bean definitions in the Spring context. ApplicationContext implementations like AnnotationConfigApplicationContext or GenericApplicationContext expose a Bean...
SPRING BOOT / CATATAN</>↗Spring Boot10 Jul 2025
Below is a step-by-step guide to create a simple CRUD API using Spring Boot and an in-memory database like H2. We will use Maven to manage the project’s dependencies. 1. Set Up Your Maven Project Create a new Maven project or directory for the Spring Boot application. pom.xml Here is the file with the necessary […]
SPRING CORE / CATATAN</>↗Spring Core09 Jul 2025
A BeanFactoryPostProcessor is a special type of bean in Spring that allows you to modify the application context’s internal bean definitions before they are instantiated. To write and register a custom BeanFactoryPostProcessor, you can follow these steps: Step 1: Implement the BeanFactoryPostProcessor Interface You need to create a class that implements the BeanFactoryPostProcessor interface. This […]
SPRING BOOT / CATATAN</>↗Spring Boot08 Jul 2025
In Spring Boot, both application.properties and application.yml are configuration files used to define application settings, but they differ mainly in syntax and structure. Here’s a detailed comparison to help you understand their essentials: 1. File Format application.properties: A key-value pair format, where each property is defined on a new line. A simple and widely used […]
SPRING CORE / CATATAN</>↗Spring Core07 Jul 2025
In the Spring Framework, a custom BeanPostProcessor can be implemented to apply custom logic before and after initialization of each bean in the application context. This is primarily useful for scenarios where you need to modify bean instances, validate configurations, or apply custom processing during the initialization phase of a bean’s lifecycle. Here’s how you […]
SPRING BOOT / CATATAN</>↗Spring Boot06 Jul 2025
Spring Boot DevTools is a valuable tool for speeding up the development process by enabling features like automatic application restart and live reload of web content. It is specifically designed to improve the development experience by reducing the time required to restart the application during testing and debugging. Here is a quick guide to using […]