I have created a simple spring boot application in Eclipse which has User class and I have written web services to perform various operations on User such as get-users, create-user, delete-user.
When I am testing the application from the browser, I am getting the below error: This application has no explicit mapping for /error, so you are seeing this as a fallback.
The path that I used: http://localhost:8080/user/get-user/Mike I have annotated User resource class @RestController and Application class @SpringBootApplication.
Code snippet :
@RequestMapping(method = RequestMethod.GET, path = "/user/get-user/{name}" )
public User getUserByName(@PathVariable String name) {
System.out.println("Request for name: "+name);
return service.getUser(name); // this return the first user found with given name
}
Here is my project structure: Project Structure