Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2
MVC: Model View Controller
Provides structured architecture. Separates application into 3 interconnected
modules. FRONT CONTROLLER provide a centralized entry point for handling requests. This servlet intercepts all incoming requests, processes them, and delegates them to appropriate handlers(controllers). Responsibilities of FC: 1. Request Handling 2. View Resolution 3. Integration 4. Centralized configuration Working: 1. Client request 2. Dispatcher servlet 3. Handler mapping: map appropriate controller for req with help of HandlerMapper 4. Controller execution 5. Model and view 6. View Resolution: View Resolver in Dispatcher Servlet 7. Response SERVLET: programming component that is used to extend the capabilities of a web server. Lifecycle of Servlet: 1. Loading & Instantiation 2. Initialization 3. Request Handling 4. Destroy RICHARDSON MATURITY MODEL 0. Level 0: The Swamp of POX all operations are invoked by sending requests to a single URL, e.g., /api/performAction 1. Level 1: Resources Each resource can be accessed via its own URL. 2. Level 2: HTTP Methods GET, POST,PUT, DELETE 3. Level 3: HATEOS (Hypermedia as the Engine of Application State) Highest Maturity where client can use hypermedia links(hyperlinks) to explore. UNIT TEST CONTROLLERS: Use MockMVC, .perform, .andExpect status, jsonPath, .value
Spring MVC & REST
1. Spring MVC Fundamentals o Setting up a Spring MVC application
o Controllers: @Controller, @RestController, request mappings
o Handling form submissions and data binding
2. RESTful Web Services with Spring
o Principles of RESTful API design
o Using annotations: @RequestMapping, @GetMapping, @PostMapping,
etc. o Handling request and response bodies with @RequestBody and @ResponseBody 3. Exception Handling o Global exception handling using @ControllerAdvice
o Custom error responses for REST APIs
4. HATEOAS o Implementing HATEOAS in Spring REST APIs