JSP is mainly used to develop the view for web applications. Sometimes it also used for business logic, But in majority of cased it is used to create the different types of view for the applications. We the help of JSP you can create data entry forms, reports, dynamic pages to display some information top the user.
The JSP specification presents two approaches for building web applications using JSP pages: JSP Model 1 and Model 2 architectures. These two models differ in the location where the processing takes place.
In Model 1 architecture, the JSP page is responsible for processing requests and sending back replies to clients.
JSP Model 1 Architecture
In Model 2 architecture, integrates the use of both servlets and JSP pages. In this mode, JSP pages are used for the presentation layer, and servlets for processing tasks.
JSP Model 2 Architecture
If you are going to use Model 2 in your project I advise you to pay attention to Struts – an open source framework for building web applications.
The MVC architecture is very popular architecture and there are many frameworks available for developing Java based web applications. MVC based frameworks are:
- Struts 2
- Spring MVC
Struts is part of the Apache Jakarta Project, sponsored by the Apache Software Foundation. The core of the Struts framework is a flexible control layer based on standard technologies like Java Servlets, JavaBeans, ResourceBundles, and Extensible Markup Language (XML), as well as various Jakarta Commons packages. Struts encourages application architectures based on the Model 2 approach, a variation of the classic Model-View-Controller (MVC) design paradigm.