Spring MVC is a A model-view-controller framework for Java web applications. It is designed to ease code writing an testing. It integrates with Spring dependency injection = inversion of control (Dependency Injection is merely one concrete example of Inversion of Control).

Spring can make use of RESTful URLs. They come in a form /items/item_id, without any extension such as .html.
CRUD operations are done via HTTP methods are PUT, POST, GET, DELETE.

Controller, View, Model, Inversion of Control, Dependency Injection, plain-old Java objects (POJOs), aspect-oriented programming (AOP)


Web Browser -> (HTTP) -> Controller -> Model -> (JDCB) -> RDBMS
Web Browser -> (HTTP) -> Controller -> View

Incoming HTTP request are handled by Controller. Controls the View and Model by exchanging data between them. This way we can separate our business logic from the UI.

Spring provides many types of controllers:
most often used;
– SimpleFormController
– UrlFilenameViewController
– AbstractController
– AbstractCommandController
– AbstractFormController
– AbstractUrlViewController
– AbstractWizardFormController
– BaseCommandController
– CancellableFormController
– ParameterizableViewController

Model and View
Many methods in Controllers return ModelAndView object. This object makes it possible to return both Model and View in one object.

Interface Validator can be implemented with two required methods, one of the two is validate, to which we pass a command and an Error object
There is also a class ValidationUtils with methods for rejecting empty fields.

Tag library
– used in JSP files via tag – binds HTML form fields to the command object

Autowiring allows Spring to do the instantiation of the class you want to make use of for you. At run time you will be able to access all methods of the class without worrying about how you got the class. This is known as Dependency Injection.