Java
  Home arrow Java arrow Page 3 - Web Development in J2EE Using the MVC Desi...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
JAVA

Web Development in J2EE Using the MVC Design Pattern
By: Dwight Peltzer
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 22
    2005-01-17

    Table of Contents:
  • Web Development in J2EE Using the MVC Design Pattern
  • Examining Servlets and Java Server Pages
  • Java Server Pages (JSPs) Resolve Servlet Issues
  • Applying the Model/View/Controller Design Pattern
  • Applying the Mediator Design Pattern

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Web Development in J2EE Using the MVC Design Pattern - Java Server Pages (JSPs) Resolve Servlet Issues


    (Page 3 of 5 )

    The introduction of Java Server Pages (JSPs) was developed to alleviate many of the problems encountered with Java Servlets.  JSPs are an extension to the Java Servlet technology. Stating it succinctly, a JSP’s life cycle ends as a servlet so they are a natural fit when paired with servlets. JSP pages are text documents containing a .jsp extension, and represent a combination of static HTML and XML-designed tags and scriptlets. The tags and scriptlets encapsulate business logic and generate content for the pages. The .jsp files are processed and converted to Java class files, then subsequently executed indirectly by a Web container.
    Many JSP advantages exist, including the following:

    • JSPs are compiled rather than interpreted, thereby enhancing performance.
    • JSPs support scripting and offer full access to the Java language.
    • JSPs can be designed as custom tags.

    JSP Model 1 and Model 2 Architectures

    Two separate JSP technological approaches exist for creating Web applications.

    • JSP Model 1 Architecture
    • JSP Model 2 Architecture

    Several differences exist between the two technologies. The prime difference lies in how the request is processed. With Model 1 architecture, a single JSP manages all requests with responsibility for displaying and returning responses to the client. In contrast, the Model 2 architecture differs in that the request is intercepted by a servlet, herein now referred to as a controller servlet. This servlet manages incoming requests and makes the determination as to how to delegate the request to an appropriate Java Bean or Enterprise Java Bean for further processing. Upon completion of the given task, the servlet calls a specific JSP to return results to the client. Consider the following:

    The client browser forwards a request directly to a JSP rather than a servlet. This preserves the concept of separating presentation from logic, whereas forwarding a request to a servlet does not. Sending a client request to a JSP allows the servlet to execute front-end processing such as user-authentication and authorization before forwarding the request to an object (Java Bean or EJB) for further processing. Upon completion, a JSP returns the results/response to the client. Notice how the Web server component utilizes servlets and Java Server Pages to process all client requests.

    More Java Articles
    More By Dwight Peltzer


     

    JAVA ARTICLES

    - Deploying Multiple Java Applets as One
    - Deploying Java Applets
    - Understanding Deployment Frameworks
    - Database Programming in Java Using JDBC
    - Extension Interfaces and SAX
    - Entities, Handlers and SAX
    - Advanced SAX
    - Conversions and Java Print Streams
    - Formatters and Java Print Streams
    - Java Print Streams
    - Wildcards, Arrays, and Generics in Java
    - Wildcards and Generic Methods in Java
    - Finishing the Project: Java Web Development ...
    - Generics and Limitations in Java
    - Getting Started with Java Web Development in...






    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
    Stay green...Green IT