The Origins of Model 1 Model 2


The Origins of Model 1 / Model 2

In documentation and general discussions surrounding Struts and MVC architectures for JSP processing, you'll frequently run across the terms Model 1 and Model 2 processing. Understanding where these terms came from will give you a better understanding of Struts and the design goals behind it. (As an added benefit, you'll also know what these people are talking about!)

The JSP Specification Version 0.92

Way back in the dark ages of JSP processing (October 7, 1998 to be exact) Sun Microsystems released the JSP 0.92 specification. A number of early container providers adopted this standard and put out JSP/servlet containers based on this version of the specification.

In this version of the specification, there was an overview that included a "JavaServer Pages Access Model(s)" section. In fact, there were only two models ”appropriately named Model 1 and Model 2. Little did the authors of this document realize that the names they gave these two models would last long after the document itself was no longer available!

Model 1 described JSP processing as it was most commonly being done at that time. It showed the HTTP request being sent directly to a JSP file. All processing was done directly in the JSP (or in the beans it interacted with) and the HTTP response came directly from this JSP file.

Model 2 was different. It indicated that a servlet, rather than a JSP file, should receive the initial HTTP request. The servlet was to handle the processing tasks required for the request, and then store the information in a bean. The bean was then to be passed to the JSP file, which would pull information from it and render the HTTP response.

MVC and Model-View-Controller don't appear anywhere in the specification, but Model 2 was clearly based on the MVC architecture that is behind Struts today.

JavaWorld , 1999

At JavaWorld in December 1999, Govind Seshadri presented an article that clearly identified Model 2 as being the MVC architecture. This article was published on the JavaWorld site and is still there as of this writing (http://www.javaworld.com/javaworld/jw-12-1999/jw-12-ssj-jspmvc_p.html).

In this article, Seshadri outlines how the Model 2 (or MVC) architecture is the best approach for development because it provides a clean separation of tasks between page designers and Java developers.

Enter Craig McClanahan, Jakarta Tomcat, and Struts

In March of 2000, Craig McClanahan launched the Struts project as a subproject of the Apache Jakarta project. Craig had been active in the Tomcat project and with Apache JServ (an early Java servlet implementation) before that.

Craig has been, without question, the leading architect and visionary behind Struts. His dedication and contributions to the open source Java community have been invaluable and critical to the success of both Tomcat and Struts.



Struts Kick Start
Struts Kick Start
ISBN: 0672324725
EAN: 2147483647
Year: 2002
Pages: 177

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net