magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 2000 > 05 > Features  

Caffeinate Your HTML with a Shot of Java

By Michael Trachtman

Java Server Pages (JSP) is a technology that lets you comingle HTML with Java. It's a powerful tool for producing dynamic Web pages. Depending on what you're trying to accomplish, JSP can often be a better alternative to ASP or PHP. Perhaps you'd like to place the contents of a Java database query directly inside an HTML table, or use Java as a bridge between your shopping-cart software and HTML. Possibly you're writing an advanced e-commerce site, like an airline reservations system in Java, and would like to allow its capabilities to be accessed via the Web. These advanced capabilities are typically beyond what can reasonably be done with HTML or JavaScript alone. But with Sun's JSP technology you can manage this easily.

Before you get started, you should know a few facts about JSP. A JSP program produces HTML. JSP programs execute on the Web server, not in the browser. In this way, JSP is very similar to Microsoft's Active Server Pages (ASP). In fact, much of JSP technology borrows concepts from ASP.

The first example that I'll show you is a very simple program that computes and displays all odd numbers between 1 and 20. This will teach you the essentials of the JSP approach to creating Web pages. Then, I'll show you a more sophisticated example that displays jokes. The user can control which joke displays and whether or not the page shows the punch line. This is a good illustration of a dynamic page—that is, one that can produce a different output each time it runs.




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2