@Restcontroller
- Extension of
@Controller
- Handles REST requests and response
Development Process
Maven dependency for Spring MVC and Jackson
1 | <!-- Add Jackson for JSON converters--> |
All Java Config: @Configuration
1 |
|
All Java Config: Servlet Initializer
1 | public class MySpringMvcDispatcherServletInitializer extends AbstractAnnotationConfigDispatcherServletInitializer { |
Create Spring REST Service using @RestController
1 |
|
Address: http://localhost:8080/test/hello