What is @Autowired in Spring boot?

I had the opportunity to use Spring boot for business, and I was scared to see many things that I couldn't find in ordinary Java, such as @Autowired and @ RestController, so I looked it up. Since the main is the front end, I don't know much about Spring. ~~ (I don't even know the front end) ~~ Please do not hesitate to point out any mistakes. .. ..

In the first place

There is a ** MVC model **. Please see here for details on this article.

view→controller→service→repository→template

It was a story that it has a structure like that.

What is @ RestController?

Annotation attached to the controller. There is a similar one, @Controller, but the return value is different. RestController is used by the controller for webApi, so what is returned is the content. (Json?) It seems that the return value of the Controller is the transition destination as it is. (I don't see this in business because vue carries all the views on his back and uses a lot of apis.)

What is @Autowired?

With this, the corresponding component will be brought from the component with @Component. Moreover, it is new and instantiated. .. good boy. .. ..

Nice references

A brief description of Spring DI and AOP Various return values in Spring MVC controller

Recommended Posts

What is @Autowired in Spring boot?
What is a Spring Boot .original file?
Spring Autowired is written in the constructor
What is Spring Tools 4
[Spring Boot] Until @Autowired is run in the test class [JUnit5]
Set context-param in Spring Boot
Major changes in Spring Boot 1.5
NoHttpResponseException in Spring Boot + WireMock
Spring Boot Hello World in Eclipse
Spring Boot application development in Eclipse
Write test code in Spring Boot
Implement REST API in Spring Boot
Event processing is performed in Spring.
Implement Spring Boot application in Gradle
Thymeleaf usage notes in Spring Boot
RSocket is supported in Spring Boot 2.2, so give it a try
What I did in the migration from Spring Boot 1.4 series to 2.0 series
What I did in the migration from Spring Boot 1.5 series to 2.0 series
What is a class in Java language (3 /?)
What is Swift? Findings obtained in 3 weeks
Launch (old) Spring Boot project in IntelliJ
[Technical memo] What is "include" in Ruby?
Build Spring Boot + Docker image in Gradle
Static file access priority in Spring boot
Output Spring Boot log in json format
Local file download memorandum in Spring Boot
Create Java Spring Boot project in IntelliJ
What is a class in Java language (1 /?)
Loosen Thymeleaf syntax checking in Spring Boot
What is a class in Java language (2 /?)
[Practice! ] Display Hello World in Spring Boot
What is the main method in Java?
Use DynamoDB query method in Spring Boot
What I got into @Transactional in Spring
What is gem'foge', require: false in Gemfile?
DI SessionScope Bean in Spring Boot 2 Filter
Change session timeout time in Spring Boot
What is Cubby
What is Docker?
What is null? ]
What is Keycloak
What is maven?
What is Jackson?
Autowired fields in a class that inherits TextWebSocketHandler in Spring Boot become NULL
What is Docker
What is self
What is Jenkins
What is ArgumentMatcher?
Challenge Spring Boot
What is params
What is SLF4J?
What is Facade? ??
What is Java <>?
What is Gradle?
What is POJO
What is Java
What is centOS
What is RubyGem?
Spring Boot Form
What is programming?
What is before_action?