MVC in JSP
MVC stands for Model View and Controller. It is a design pattern that separates the business logic, presentation logic and data.
Controller acts as an interface between View and Model. Controller intercepts all the incoming requests.
Model represents the state of the application i.e. data. It can also have business logic.
View represents the presentaion i.e. UI(User Interface).
Advantage of MVC (Model 2) Architecture
If you new to MVC, please visit Model1 vs Model2 first.
MVC Example in JSP
In this example, we are using servlet as a controller, jsp as a view component, Java Bean class as a model.
In this example, we have created 5 pages: