February 2015
Intermediate to advanced
178 pages
3h 47m
English
JAX-RS provides the functionality for Representational State Transfer (RESTful) web services. REST is well-suited for basic, ad hoc integration scenarios. Spring MVC offers controllers to create RESTful web services.
In Spring MVC 3.0, we need to explicitly annotate a class with the @Controller annotation in order to specify a controller servlet and annotate each and every method with @ResponseBody to serve JSON, XML, or a custom media type. With the advent of the Spring 4.0 @RestController stereotype annotation, we can combine @ResponseBody and @Controller.
The following example will demonstrate the usage of @RestController:
RESTfulWeb.web.xml file and add a configuration to intercept ...Read now
Unlock full access