Getting “No message available” error with Spring Boot + REST application

后端 未结 10 2484
感动是毒
感动是毒 2020-12-30 02:02

I have created demo Spring Boot project and implemented Restful services as shown here

@RestController
public class GreetingsController {
    @RequestMappin         


        
10条回答
  •  长情又很酷
    2020-12-30 02:34

    This can help someone as it was in my case.

    Make sure the package name of the controller is the derived (or child) package of your Spring main method package.

    For example:

    If the main method package is com.company.demo.example then the controller package should be like com.company.demo.example.controller (if you specify something like com.company.demo.controller it won't work!).

提交回复
热议问题