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 > 1998 > 01 > Java Alley  

A Web Application

Let's create a Web application that will show off Java in all its glory. The application will consist of a Java program running on the Web server and an applet downloaded to the browser. The applet will collect a user's email address, verify it (make sure it doesn't contain spaces and does contain an @ symbol), and send it to the Web server. The application running on the server will capture the data and check a data file containing the email addresses. If that address is already in the file, it will return a message to that effect, which will be displayed by the applet; otherwise, the address will be placed in the list and the applet will be notified.

Traditionally, such applications were handled by creating an HTML page with a text field and a submit button. The user typed something into the text field, and the Web page submitted it to the server, specifying the CGI program the server should run after receiving it. The CGI program, typically written in Perl or C, determined whether the data was in the correct format. If so, the CGI program opened the data file and either found the email address there or added it. If not, the CGI program created an HTML page to describe the problem and handed it to the server; the server sent it back to the user, who then went to a previous page via the Back button and tried again. In both cases, an appropriate HTML page had to be formatted for the server to return to the user.

Java eliminates a lot of this tedium. A Java applet can handle data validation on the client side, and a Java application running on the server can replace the Perl CGI script.




  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