https://spring.io/guides The so-called official tutorial. Various patterns of "Hello World" are prepared.
Spring can do many things with standard features. When defining requirements, I wondered if it would be possible to develop with less man-hours if I knew what Spring could do. (Maybe you should google each time) I think it's difficult to grasp the total amount of Spring, so I thought about trying the official guide first.
I'll translate the Guide to give you a rough overview and a description of the main annotations. I hope it can be used as an index.
Building a RESTful Web Service https://spring.io/guides/gs/rest-service/ RESTful web service. It should be helpful when creating a so-called API. @RestController The class that defines it is the controller that returns the domain object, not the view. A collection of @Controller and @ResponseBody.
@RequestMapping Map methods and HTTP requests. It's like executing the greeting method when receiving an HTTP request to / greeting.
@RequestParam Bind the query parameter to the corresponding argument.
Scheduling Tasks https://spring.io/guides/gs/scheduling-tasks/ Batch processing that starts on time. @Scheduled You can set the startup interval and time (cron image).
@EnableScheduling Enable schedule processing.
Consuming a RESTful Web Service https://spring.io/guides/gs/consuming-rest/ You can easily call RESTful web services and objectify the results. It can also be used as a mock for unit testing.
You can call the API with GET or POST and convert the result to a Java object.
Building Java Projects with Gradle How to build with Gradle. Omitted.
Building Java Projects with Maven How to build with Gradle. Omitted.
Accessing Relational Data using JDBC with Spring https://spring.io/guides/gs/relational-data-access/ You can connect to RDB without writing xml or definition. If you do not specify the connection destination, use H2 (in-memory DB) Looks good when making a rough proto.
Updated from time to time ...!
Recommended Posts