SPRING CONCEPTS
Connect Spring to familiar Java concepts
Spring Concepts / Detailed guide
| What you already know | Spring equivalent | What changes |
|---|---|---|
| new Service() inside a Servlet | Constructor injection of a Spring bean | The container constructs and supplies the service. |
| doGet / doPost | @GetMapping / @PostMapping | Methods declare the HTTP routes they handle. |
| request.getParameter | @ModelAttribute / @RequestParam | Spring binds request inputs into Java values. |
| request.setAttribute + RequestDispatcher.forward | Model attributes + view name | The view resolver finds the template. |
| JSP + JSTL | Thymeleaf templates + th:* attributes | HTML templates are rendered on the server. |
| Servlet filters | Spring Security filter chain | Security runs before controller methods. |
| Manually configuring Tomcat | Boot embedded Tomcat | The web server starts with main(). |
| JDBC DAO | MongoRepository | The Spring Data proxy supplies document CRUD. |