@Error in restcontroller annotation

If the @ restcontroller annotation can’t recognize the red, the reason is that there is no web dependency added to the POM file.

<dependency>
       <groupId>org.springframework.boot</groupId>
       <artifactId>spring-boot-starter-web</artifactId>
</dependency>

If a web dependency is added or an error is reported, it may be that there is no specified version number, so Maven can’t recognize


the solution is to enter the pom.xml file, click this location, find the dependency with the corresponding version number, replace the original dependency and import it again


Read More: