Java
  Home arrow Java arrow Page 6 - Creating Your First JSP Page
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  
Moblin 
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

Creating Your First JSP Page
By: Apress Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 31
    2005-04-27

    Table of Contents:
  • Creating Your First JSP Page
  • Downloading Tomcat
  • Trying It Out: Testing Tomcat
  • Creating Your First Web Application
  • Exploring a Brief History of Java and the Web
  • Java and the Web
  • The Java Community

  • 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


    Creating Your First JSP Page - Java and the Web


    (Page 6 of 7 )

    At last we come to Java. Java was initially released in the mid-1990s as a way to liven up dull, static Web pages. It was platform-independent (the same Java code can run on computers running a variety of different operating systems rather than being tied to just one), and it allowed developers to have their programs execute in the Web browser. Many an industry sage prognosticated that these Java applets (applet being a “mini-application” that executes within another application—the browser) would catch on, making the Web more exciting and interactive and changing the way people bought computers, reducing all the various operating systems into mere platforms for Web browsers (see Figure 1-5).


    Figure 1-5.  A Java applet in action

    NOTE  Figure 1-5 shows one of many applets available at http://java.sun.com/applets/.If you enter the URL shown in Figure 1-5, don’t forget to capitalize it as it appears.

    However, Java applets never really caught on to the degree people predicted, and other technologies such as Macromedia Flash became more popular ways of creating interactive Web sites. However, Java isn’t just good for applets: You can also use it for creating stand-alone platform-independent applications. Although these too could threaten the monopolies of entrenched incompatible operating systems, Java applications haven’t really caught on yet either. This is probably because Java’s support for creating graphical user interface (GUI) applications—applications with windows, icons, buttons, and so on—has until recently been quite poor and slow. This situation is changing; in fact, today’s versions of Java enable developers to create cutting-edge GUI applications.

    But like a prizefighter who won’t stay down, those innovative Java architects kept on fighting, releasing Java servlets into the arena. Servlets (“mini-servers”) are another alternative technology to CGI. Servlets aren’t stand-alone applications, and they must be loaded into memory by a servlet container. The servlet container then functions as a Web server, receiving HTTP requests from Web browsers and passing them to servlets that generate the response, typically an HTML document. Alternatively, the servlet container can integrate with an existing Web server; for example, a popular Apache module, called a connector and found on the Tomcat Web site, integrates Apache with the Tomcat servlet container.

    The simplicity of the Java programming language, its platform-independent nature, Sun’s open-source and community-driven attitude toward Java, and the elegance of the servlet model itself have all made servlets an immensely popular solution for providing dynamic Web content.

    JSP

    To make creating dynamic Web content even easier, Sun introduced JSP. Although writing servlets can require extensive knowledge of Java, a Java newbie can learn some pretty neat tricks in JSP in a snap. JSP represents a viable and attractive alternative to Microsoft’s ASP.

    NOTE  JSP technology is actually built on top of servlets. As you’ll see later in the book, the two technologies actually work well together, and it’s common to use both in the same Web application.

    More About Servlet Containers

    As mentioned earlier, JSP and servlets require a special kind of server to operate: a servlet container. Tomcat, which you installed earlier, is known as a reference implementation of a JSP servlet container, but this isn’t to say it’s not worthy of use in production systems. Indeed, many commercial installations use Tomcat, but many other servlet containers are available. These include Caucho Resin (http://www.caucho.com), which is very popular and somewhat faster than Tomcat but is a commercial product that must be purchased. Jetty (http://jetty.mortbay.org) is perhaps the most popular open-source competitor, and there are many alternatives.

    More Java Articles
    More By Apress Publishing


     

    Buy this book now. This article is excerpted from Beginning JSP 2: From Novice to Professional, by Peter den Haan et al (Apress, 2004; ISBN: 1590593391). Check it out at your favorite bookstore. 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-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT