Controller classes

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)
@ResponseBody
public 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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.10.153