[JAVA] A memo that touched Spring Boot

Features of Spring Boot

It seems that it is a big feature that it is possible to program ignoring the existence of Servlet like other languages by using annotations.


Annotation Overview
@ Conponent The most basic annotation to register as a bean in the DI container
@ Configuration Annotation for Java-based bean definition * I don't understand what you mean, so I will explain it later.
@ Repository Annotation indicating a class for handling data storage and loading. When using a database such as Spring Data, there are cases where it has a special meaning, such as allowing the table to be accessed automatically by specifying this annotation.
@ Controller Annotation indicating that it is an MVC controller class.
@ Service Annotation indicating a class for handling business logic etc.

As a special thing in each subproject, different annotations are defined, overriding these annotations.

Annotation Overview
@ SpringBootApplication Annotations used as a convention to specify the main program of a Spring Boot application
@ RestController Annotation for registering as a controller for REST
@ RestControllerAdvice Annotation for defining common processing such as conversion of input data format common to each controller and error processing.

--When using maven --If you list the dependency packages in the pom.xlm file, the required packages will be loaded automatically. --ʻApplication.properties` A place to list the settings used in each package. --When using gradle ――I plan to use it from now on

Annotation summary around Entity


Summary of settings around Spring Boot log


Description method when creating Rest API


How to use JpaRepository

http://terasolunaorg.github.io/guideline/5.5.1.RELEASE/ja/ArchitectureInDetail/DataAccessDetail/DataAccessJpa.html How to use when you want to search by adding more conditions https://qiita.com/ksh-fthr/items/44ecc0550a77f4280ea7

Periodic execution with Spring Boot

https://qiita.com/[email protected]/items/4f0c64eb9a24eaceaa6e https://reasonable-code.com/spring-boot-scheduling-tasks/

Create Batch with Spring Boot


Spring Boot Actuator A service that provides functions such as monitoring, metrics, and auditing. Just deploy and automatically apply audit, health, and metric collection to your application.

As a caveat, if the endpoint is set to a point without authentication, there is a risk that the security information of the server will be disclosed, so it is necessary to carefully develop the endpoint disclosure.

Spring Boot Actuator documentation

Recommended Posts

A memo that touched Spring Boot
Spring boot memo writing (2)
Spring boot controller method memo
A memo that I was addicted to when making batch processing with Spring Boot
PHP-based engineer touched Java's Spring Boot
What is a Spring Boot .original file?
[MVC model] A memo that a beginner learned MVC
Spring Boot + Thymeleaf BootStrap installation method memo
Spring retrospective memo
A story about a Spring Boot project written in Java that supports Kotlin
Autowired fields in a class that inherits TextWebSocketHandler in Spring Boot become NULL
Challenge Spring Boot
Personal memo Features of Spring Boot (mainly from a DI point of view)
Spring Boot Form
Spring Boot Memorandum
gae + spring boot
Create a website with Spring Boot + Gradle (jdk1.8.x)
Create a simple search app with Spring Boot
Run a Spring Boot project in VS Code
Create a Spring Boot application using IntelliJ IDEA
A memo for myself that object-oriented is something
Java tips-Create a Spring Boot project in Gradle
Deploy a Spring Boot application on Elastic Beanstalk
Create a web api server with spring boot
Create a Spring Boot development environment with docker
Introducing the Spring Boot Actuator, a function that makes the operation of Spring Boot applications easier.
Create a portfolio app using Java and Spring Boot
SPRING BOOT learning record 01
Please note that Spring Boot + Tomcat 8.5.8 cannot be used!
Spring Boot + Heroku Postgres
A memorandum of addiction to Spring Boot2 x Doma2
Spring Security usage memo: Cooperation with Spring MVC and Boot
[JUnit 5 compatible] Write a test using JUnit 5 with Spring boot 2.2, 2.3
How to create a Spring Boot project in IntelliJ
First Spring Boot (DI)
SPRING BOOT learning record 02
Spring Boot2 cheat sheet
Create a web app that is just right for learning [Spring Boot + Thymeleaf + PostgreSQL]
Spring Boot exception handling
Implement a simple Rest API with Spring Security with Spring Boot 2.0
Spring boot Things that beginners tend to have (@ComponentScan)
Spring Boot Servlet mapping
Spring boot development-development environment-
Spring Boot learning procedure
A site that was easy to understand when I was a beginner when I started learning Spring Boot
[JUnit 5] Write a validation test with Spring Boot! [Parameterization test]
[Introduction to Spring Boot] Submit a form using thymeleaf
Learning Spring Boot [Beginning]
A memorandum when creating a REST service with Spring Boot
Spring Boot 2.2 Document Summary
Create a simple demo site with Spring Security with Spring Boot 2.1
[Spring Boot] DataSourceProperties $ DataSourceBeanCreationException
Load an external jar from a Spring Boot fat jar
Spring Boot 2.3 Application Availability
A story that stumbled when deploying a web application created with Spring Boot to EC2
Spring boot tutorials Topics
I wrote a test with Spring Boot + JUnit 5 now
A memo that handles a class created independently with ArrayList
Download with Spring Boot
Sample web application that handles multiple databases in Spring Boot 1.5
Spring Boot application that specifies DB connection settings with parameters