79210134

Date: 2024-11-21 07:49:12
Score: 1
Natty:
Report link
@RequestMapping("user")
    public User data() {
        User user = new User();
        user.setAge(22);
        user.setName("kt");
        return user;
    }

Specify request mapping method for example GET or POST based on requirement and try. @RequestMapping will be use like below.

@RequestMapping(path = "/user", method = RequestMethod.GET) OR @RequestMapping(path = "/user", method = RequestMethod.POST)

Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @RequestMapping
  • Low reputation (0.5):
Posted by: Satyajit Bhatt