Java
  Home arrow Java arrow Page 7 - JavaServer Pages, conclusion
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 
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

JavaServer Pages, conclusion
By: Apress Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 2 stars2 stars2 stars2 stars2 stars / 5
    2005-11-10

    Table of Contents:
  • JavaServer Pages, conclusion
  • The config Object
  • Try It Out: Using JavaBeans in JSP Pages
  • Translation and Compilation
  • The Deployment Descriptor
  • Including and Forwarding from JSP Pages
  • Summary

  • 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


    JavaServer Pages, conclusion - Summary


    (Page 7 of 7 )

    In this chapter, we've taken a tour of many of the basic features of JSP pages. With the information in this chapter, you should be able to easily begin creating JSP web applications of your own. After completing this chapter you should have learned:

    • JSP pages consist of HTML data, also known as template data, and Java code.
    • You can specify an error page for a JSP using %@page errorPage=""% . Error pages are used to provide a meaningful error page to a user when something bad happens to the web application.
    • You can import Java packages for the page using <% pageimport="" %>.
    • Java code is included in the page using a declaration <%!declaration %>, a scriptlet <% scriptlet %>, or an expression <%= expression %>. These elements allow you to mix Java code with the template data in the page.
    • JavaBean instances can be created using the <jsp:useBean> standard action; properties of the bean can be set using <jsp:setProperty>; and the value of a beans properties can be obtained using <jsp:getProperty>. JavaBeans are one way to encapsulate business or domain logic so that JSP pages can be used primarily for presentation.
    • Various implicit objects such as request, response, out, session, and so on, are always available to the JSP to help process a request. The session object is particularly useful because it enables the web application to keep track of user information. One example of the usefulness of this is an e-commerce application that needs to keep track of a users shopping cart.
    • Servers translate and compile JSPs into Java classes that behave like servlets.
    • You can specify error handlers for the entire application using the <error-page> element in the deployment descriptor.
    • A JSP can include the output of other JSPs or servlets in the response to clients. This is done through the <jsp:include> standard action.
    • A JSP can forward a request to another JSP or servlet for processing. This is done through the <jsp:forward> standard action.

    Thats quite a lot. All these features put together allow application developers to create dynamic and powerful web applications that can be used for many purposes from chat rooms to e-commerce, from virtual communities to business applications. However, you may have noticed that as the examples in this chapter became more dynamic, more featured, they also tended to have more and more Java code interspersed in the JSP pages. This tends to be a problem because web page developers are often not Java developers.

    What would be ideal is a way to create JSP pages that hide the Java code from the page developers. This would allow the page developer to concentrate on the format and structure of the markup, and leave Java developers free to work on only the Java code. There are several ways to do this, and we will see some of them in the next chapter, where we explore some of the new JSP features introduced in the latest version of the JSP specification.

     

     


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · This article is an excerpt from the book "Beginning J2EE 1.4 From Novice to...
     

    Buy this book now. This article is excerpted from chapter three of Beginning J2EE 1.4 From Novice to Professional, written by James L. Weaver, Kevin Mukhar, and Jim Crume (Apress, 2004; ISBN: 1590593413). Check it out at your favorite bookstore today. Buy this book now.

    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-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    Stay green...Green IT