I have created demo Spring Boot project and implemented Restful services as shown here
@RestController
public class GreetingsController {
@RequestMappin
Apart from the anotatting the SpringBoot entry point with @SpringBootApplication((scanBasePackages = "com.duwamish.x.y") so that it includes all the spring components/beans when initialized,
The contextPath also has to be right. If the application is deployed to tomcat with the application name as myapplication see below,
$ ll /usr/local/apache-tomcat-8.0.42/webapps/
total 179216
12495017 drwxrwxrwx 17 urayagppd NORD\Domain Users 578 Mar 8 11:59 ROOT
12495019 drwxrwxrwx 55 urayagppd NORD\Domain Users 1870 Mar 8 11:59 docs
12495042 drwxrwxrwx 7 urayagppd NORD\Domain Users 238 Mar 8 11:59 examples
12495109 drwxrwxrwx 7 urayagppd NORD\Domain Users 238 Mar 8 11:59 host-manager
12495114 drwxrwxrwx 8 urayagppd NORD\Domain Users 272 Mar 8 11:59 manager
16169612 drwxr-xr-x 4 urayagppd NORD\Domain Users 136 May 7 18:47 myapplication
16169594 -rw-r--r-- 1 urayagppd NORD\Domain Users 45340041 May 7 18:47 myapplication.war
Then REST endpoint would be /myapplication/api/greetings
But if the application war is deployed as ROOT, the endpoint resource will be /api/greetings only.