Reviews
  Home arrow Reviews arrow Page 2 - New Technologies and What They Mean To You...
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? 
REVIEWS

New Technologies and What They Mean To You: Part 3
By: Jeremy Wright
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 5
    2003-02-04

    Table of Contents:
  • New Technologies and What They Mean To You: Part 3
  • JSP
  • CGI
  • Conclusion

  • 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


    New Technologies and What They Mean To You: Part 3 - JSP


    (Page 2 of 4 )

    Definition

    JSP is a Sun Micrososystems technology. You know Sun, the company behind Java? Good company, and JSP extends an already good technology. JSP is a free specification for extending Java Servlets to generate dynamic web pages on a web server.

    Like most of our other technologies, JSP lets developers create dynamic HTML or XML pages that combine static page elements with dynamic content. This allows smart developers to separate the user bits like HTML from the logic bits, like the JSP code. JSP was created to simplify the Java Servlets technology, which we’ll cover in a future article, and to be simpler than the other offerings, like CGI, available at the time of its creation.

    What It Really Is

    So we understand that JSP is an extension of Java, for web pages, but what is it really about? For most people, that is Java’s biggest appeal; that they can tie into existing Java elements, and therefore save a lot of development time.

    JSP is based on components. It uses JavaBeans and Enterprise JavaBeans (EJB) components which hold the business logic for an application, and it composes tags and a scripting platform for presenting the content generated and returned by the beans into HTML pages. The components structure means that non-Java developers can use JSP to manipulate beans that developers have built. On the other hand, Java developers can use these beans and Java in JSP pages for more advanced productions based on the beans.

    A common JSP rollout would look something like this:

    BROWSER <-> JSP PAGE <-> BEANS/ELEMENT <-> DATABASE


    What is really happening in this process? A user calls a JSP page through their browser, so Resin (for instance), located on the web server, converts JavaScript, JSP tags, and HTML into segments of Java code, which the engine then consequentially arranges into a core Java servlet. This core servlet is therefore pre-assembled and works 'behind the scenes'. It is called every time that particular page is requested by a user, saving valuable recompiling time. The next time a user calls that page from their browser, because the JSP code has already been compiled, it does not have to convert the JavaScript, HTML, etc each time. That is, the servlet engine needs only to produce that servlet once, or after the last code change was updated.

    JSP uses a combination of XML and CFM-like tags, as well as scripts written in Java, to generate page content. Applications written to the JSP specification can be run on compliant web servers, and web servers such as Apache, Netscape Enterprise Server, and Microsoft IIS that have had Java support added.

    Advantages
    • Strong integration with JavaBeans and other elements
    • Ease of use for experienced Java developers
    • Rapid Application Development
    • Scales well to heavy loads
    • Cross-platform
    • Open Source
    Disadvantages
    • JSP pages often run slower than similar pages such as PHP due to being more robust and intensive
    • Steeper learning curve than many other technologies
    Examples

    For many, many examples of JSP usage, as well as the full manual, go to http://java.sun.com/products/jsp/index.html.

    Here are some standard types of things you might find...

    Including a file:

    <%@ include file="dukebanner.html" %>

    Conditionally including a file:

    <%
      if ( request.getParameter("username") != null )
      {
        include file="response.jsp"
      }
    %>


    Custom JSP tag:

    <jsp:setProperty name="numguess" property="*" />

    Similar Technologies

    Really, any Net-based scripting language is “similar” to JSP in that it fulfills the same goals, and we will look at most of these during the rest of this article series:
    • ColdFusion: ColdFusion is Macromedia’s offering for web-based dynamic content. While it isn’t technically “scripting”, as it is based on an HTML-like tag structure, it does fulfill the same goal of providing dynamic webpages.
    • PHP: Like JSP, PHP is cross-platform. In some ways it is simpler to develop, because it doesn’t require separate files for logic and procedures, and in other ways it is harder to develop in (for basically the same reason). PHP is a very strong language with an incredibly large and supportive community.
    Links

    There are many sites out there dedicated to JSP. Many of the best ones are provided by the suppliers and backers (IBM, Sun, etc) but there are also lots of other great resources, and we’ve gathered some of the best ones here:

    Tutorials

    ServerPages.com Tutorials
    http://www.serverpages.com/Java_Server_Pages/Tutorials/index.html

    Building Your Own JSP Components
    http://developer.iplanet.com/viewsource/fields_jspcomp/fields_jspcomp.html

    Introduction to JSP
    http://www6.software.ibm.com/reg/java/jsp-i

    JSP By Example
    http://java.sun.com/products/jsp/html/jspbasics.fm.html

    Marty Hall’s Tutorials
    http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/

    Resources

    JavaServer Pages (Sun Microsystems)
    http://java.sun.com/products/jsp/

    Developer’s Guide
    http://java.sun.com/products/jsp/docs.html

    Tomcat
    http://jakarta.apache.org/tomcat/


    Resource Directory for Server Pages
    http://www.serverpages.com/Java_Server_Pages/

    JSP Resources
    http://www.jsptags.com/

    The JSP Resource Index
    http://www.jspin.com/

    JSP Insider
    http://www.jspinsider.com/

    More Reviews Articles
    More By Jeremy Wright


     

    REVIEWS ARTICLES

    - Super Styling with a Dedicated CSS Editor
    - Book Review: Ground-Up Java by Philip Heller
    - Book Review: Winning E-Brand Strategies: Dev...
    - New Technologies and What They Mean To You: ...
    - Review: Namo WebEditor 5







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek