July 2018
Intermediate to advanced
268 pages
7h 36m
English
We have two controller classes, SecuredController and NonSecuredController. As the name suggests, one is for declared secured routes and the other for unsecured routes. The main method in the secured controller that we are interested is shown in the following code snippet:
@RequestMapping(value = "/movie/index", method = RequestMethod.GET)@ResponseBodypublic Movie[] index() { Movie[] movies = movieAppRestTemplate .getForObject(movieApiBaseUri, Movie[].class); return movies;}
We copied the model class used in the resource server project into the client application project as well. In an ideal scenario, all this common stuff would be converted into reusable JARs and set up as a dependency to both the projects.
Read now
Unlock full access