Spring Boot: Custom PropertyEditor Example
In Spring, custom PropertyEditor implementation converts a custom object’s value to and from its native type representation into a String.
In Spring, custom PropertyEditor implementation converts a custom object’s value to and from its native type representation into a String.
Spring boot @Scheduled example to schedule jobs at a fixed rate, fixed delay, using a cron expression and concurrent task executions.
Learn how to use Spring Boot CommandLineRunner interface with examples, and how it is different from the ApplicationRunner interface.
Spring boot loads lots of beans internally to run the application with minimal configuration. In this example, we will learn to find out all those loaded beans by Spring Boot and their class type information. Using ApplicationContext to get all loaded beans To execute a method automatically, when the application …
Learn the default spring boot logging and configuring custom log levels, file appenders and colored logs via application.yaml file.
Configure Spring Boot logging with logging.* properties only. Set levels per package, write log files with rotation, and use log groups, patterns and colors. Then write JSON logs and change levels at runtime with Actuator. Tested on Spring Boot 4.1.1.
Spring Boot bundles Tomcat and Jetty dependencies as separate starters to make easy switching them using configurations and properties.
By default, Spring boot embedded server starts at port 8080. Learn to change the default port using Java configuration, command line, and properties.
By default, Spring boot applications are accessed by context path “/”. We can customize it using server.contextPath or server.servlet.context-path.
Spring Boot JSP example: add tomcat-embed-jasper and the Jakarta JSTL artifacts, set spring.mvc.view.prefix and suffix, use war packaging, and render a list page and a form with embedded Tomcat.
Learn Spring RestTemplate with a tested Spring Boot 4.1.2 appointment API. Create, read, update and delete a resource; inspect response status, headers and HTTP errors.
HowToDoInJava provides tutorials and how-to guides on Java and related technologies.
It also shares the best practices, algorithms & solutions and frequently asked interview questions.