Home arrow Java & J2EE arrow Page 10 - Overview of Java Web Technologies, Part 2

Model 2 Architecture - Java

Today, Budi walks us through a refresher and brief overview of server JSP programming. Today's portion covers JavaServer Pages (JSP), with a thorough overview of JavaBeans and Tags. This excerpt comes from chapter one of JavaServer Faces Programming, by Budi Kurniawan (McGraw-Hill/Osborne, ISBN 0-07-222983-7, 2004).

  1. Overview of Java Web Technologies, Part 2
  2. Sun's Solution
  3. JSP and JavaBeans
  4. Calling a Bean from a JSP Page
  5. Accessing Bean Properties
  6. Custom Tags
  7. Developing and Using Custom Tag Libraries
  8. Writing a Tag Handler
  9. Writing and Using Tags
  10. Model 2 Architecture
By: McGraw-Hill/Osborne
Rating: starstarstarstarstar / 9
March 03, 2004

print this article



Java Web application can be designed based on Model 1 or Model 2. Model 1 is for very small applications that will never grow more complex and consists of JSP pages only. Each JSP page references another JSP page, making maintenance very hard as the application grows bigger. The Model 2 architecture is the recommended design model for medium sized and large applications, and is based on the Model-View-Controller (MVC) pattern. A Model 2 architecture is indicated by the presence of a controller servlet between the client browser and the JSP pages (or the servlets that present the content). See Figure 6. The controller servlet dispatches HTTP requests to the corresponding presentation JSP pages—based on the request URL, input parameters, and application state. In this model, presentation parts (JSP pages or servlets) are isolated from each other.


Figure 6 Model 2 Architecture

Model 2 applications are more flexible and easier to maintain, and to extend, because views do not reference each other directly. The Model 2 controller servlet provides a single point of control for security and logging, and often encapsulates incoming data into a form usable by the back-end MVC model.

JSF is based on the Model 2 architecture, in which there is one controller servlet and multiple JSP pages. The controller servlet is called Faces Servlet and is already provided by the JSF implementation. The development of a JSF application focuses on the authoring of JSP pages and the writing of other components.


To start developing JSF applications, you need to be familiar with servlets and JSP technologies and related technologies, especially JavaBeans and custom tag libraries. It is also helpful if you are familiar with the Model 2 architecture as JSF is based on this design model. This chapter provided a brief review of the four technologies as well as the Model 2 architecture. For more details on these technologies you should consult a servlet/JSP book, such as my own “JavaWeb Development with Servlets, JSP, and EJB, Second Edition” (Sams Publishing, 2004).

Buy this book now!Remember: This is part two of the first chapter of JavaServer Faces Programming, by Budi Kurniawan (McGraw-Hill/Osborne, ISBN 0-07-222983). Stay tuned for more chapters of developer books from McGraw-Hill/Osborne.
Buy this book!

>>> More Java & J2EE Articles          >>> More By McGraw-Hill/Osborne

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- More Java Bugs Lead to More Attacks
- Oracle's Java One Brings News, Surprises
- Oracle Patches Java Runtime Environment
- Apple Syncs Java Update with Oracle
- Spring 3.1 Java Development Framework Compat...
- Jelastic Java PaaS Availability and Pricing ...
- NetBeans 7.1 Released, Supports JavaFX 2
- SolarWinds Releases Newest Version of Java M...
- Free Monitoring Tool for Java Apps on Heroku
- Heroku Adds JCloud Platform Support, Java 7 ...
- Java SE 8 Speculation in Full Swing
- Java SE 7 Now Available
- New JVM Language and Java Reporting Tool
- Java 7 Release Update and New Eclipse Toolkit
- The Best Java Netbeans IDE Plugins

Developer Shed Affiliates


Dev Shed Tutorial Topics: