In an MVC Model 2 application, Servlets and JSPs are used together, but have completely different roles.
- Servlets are used as part of the controller. An incoming request is handled by executing a particular peace of code, called an action, which in turn interacts with the application's model.
- JSPs are used as part of the view. This means, after one or more actions have been executed, a request is dispatched to a JSP page. The view is responsible for displaying data provided by the actions. Doing this may bring up formatting and i18n issues. However, in no circumstances, it performs business logic.
The promise of the MVC Model 2 approach is to increase reusability, scalability and maintainability while reducing complexity. In practice, it is very hard to build a Model 2 application from scratch. This is where the need for a framework like Calyxo comes into play.
Let us give you a brief introduction to Calyxo's components.