About the Model 2 Versus Model 1 Architecture

Early web application design regarded the JSP page as the focal point for the entire application. Termed Model 1 architecture, the JSP page not only contains the display elements to output HTML, but is also responsible for extracting HTTP request parameters, call the business logic (implemented in JavaBeans, if not directly in the JSP), and handle the HTTP session. Although Model 1 is suitable for simple applications, this architecture usually leads to a significant amount of scriptlets (Java code embedded within HTML code in the JSP page), especially if there is a significant amount of request processing to be performed.

The following diagram illustrates the JSP Model 1 architecture.

JSP Model 1 architecture

As a response to the Model 1 architecture, Apache Software Organization developed the Jakarta Project's Struts framework. Struts is an open source framework for building web applications that integrate with standard technologies, such as Java Servlets, JavaBeans, and JSP. Struts offers many benefits to the web application developer, including Model 2 implementation of Model-View-Controller (MVC) design patterns in JSP web applications. The MVC Model 2 paradigm applied to web applications lets you separate display code (for example, HTML and tag libraries) from flow control logic (Struts action classes).

The following figure illustrates the Model 2 web application architecture, where Servlets control the flow of the web application and delegate the business logic to external components, usually JavaBeans or EJBs, while JSP pages generate the HTML for web browsers:

JSP Model 2 architecture

The following information gives a brief overview of the MVC Model 2 design pattern and the role of Oracle ADF:

For further background about Oracle ADF:

For page-flow design guidelines:

To learn how you can implement Model 1 and Model 2 web applications:


Copyright © 1997, 2004, Oracle. All rights reserved.