-3

I requested method and see how it runs but get 404 error

@RequestMapping(method = RequestMethod.GET)
public User getUser(@RequestHeader(value="Access-key") String accessKey,
                    @RequestHeader(value="Secret-key") String secretKey){
        User u = this.userService.chkCredentials(accessKey, secretKey);
        System.out.println(u.toString());
        return u;
}

I can see results in System.out.print() and then something happens and return statement don't returns object.

The stack trace is,

WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/WEB-INF/views/user.jsp] in DispatcherServlet with name 'appServlet'.

But all other methods convert object into JSON and returns it

spiderman
  • 10,892
  • 12
  • 50
  • 84
user3378876
  • 1,816
  • 4
  • 24
  • 26

1 Answers1

0

The return value of the method is to point a view. The error message indicates that the controller cannot find view corresponding the User object. Documentation here: http://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.html

suztomo
  • 5,114
  • 2
  • 20
  • 21