Image8.gif (38059 bytes)      Java News Brief        
                                                                                                  SEPTEMBER   ISSUE                                        


St. Louis:     12140 Woodcrest Executive Drive, St. Louis, MO 63141    Office: 314-579-0066
Tempe:        4500 S. Lakeshore Drive, Suite 359, Tempe, AZ 85282      Office: 480-752-0042   1-888-962-4624   Java.jpg (3634 bytes)

Headlines: 
 
Java Technical Insight of the Month   -  
Java Server Pages (JSP)
New Java Open Enrollment Schedule
  - Tempe OCI Education Center
JavaBeans Programming   October 25-26 - St. Louis OCI Education Center
Why Java? 
here are a few reasons...
                 
Java Technical Insight of the Month
 
Java Server Pages
By Chris Eddy, Senior Software Engineer, Object Computing, Inc.

What is JSP?

Java Server Pages (JSP) is a technology developed in collaboration between Sun Microsystems and web server industry giants such as BEA, Netscape, IBM and others.  JSP documents are server-side documents containing instructions which need to be processed before being transmitted to the client.   These instructions could be as simple as displaying the current time, or they could perform complex data retrieval and manipulation.  JSP documents, therefore, are not "readable" by a client browser until they have been executed on the server for transfer to the client, in a browser friendly format such as HTML or XML.  JSP enables the rapid creation of dynamic web pages with reusable components. Since this technology is based on Java, it is platform-independent as well as server-independent.

How does JSP fit into the typical Web Application?

The client sends a request to the web server, which recognizes the requested page as a JSP page.  This is server dependent, but usually the extension on the page is the clue (such as .jhtml).  The JSP page can contain references to shared bean components, as well as embedded Java code, called "scriptlets".  The WebServer will then parse the document, searching for specific "JSPTaglets" identifying the scriptlets.  The code lying inside these taglets is parsed and compiled into the Servlet Engine, creating a servlet class file.  This servlet will execute and return a dynamically generated response.   The response will be devoid of any scriptlet code, having been replaced by the output from the servlet.  On subsequent requests, the parse and compile steps are omitted, unless the JSP page is newer than the class file.  Therefore, the first call may be slow, but the following requests are fast since the code will already have been compiled and loaded into memory.

What are "Scriptlets"?

JSP scriptlets are written in the Java programming language.  This language is essentially the same Java we all know and love, with a few minor enhances to make coding these "scriptlets" inside HTML easier.   These changes include API's to aid in the retrieval of request parameters, as well as methods to allow for invoking other JSPs.  The scriptlets are embedded in the JSP document between JSPTaglets marking the start and end of the scriptlet.

Can I use JavaBeans with JSP?

Through the BEAN tag, JSP allows access to JavaBeans.   The bean tag provides many attributes to configure how the bean is used.  It is possible to have a JavaBean's properties updated directly from a submitted form, limit a beans scope to a single request or a complete session, and name the bean.

How can I create and test JSP?

Sun provides a development and testing tool through its JavaServer Web Development Kit (jswdk-1.0) which is available at http://java.sun.com/products/jsp/download.html.    This tool can serve JSP documents, servlets, as well as straight HTML documents, and it is free of charge.  The tool essentially runs as a small webserver and servlet engine, giving a complete development and testing environment for JSP Pages.

A Simple Sample

(This sample was run using the jswdk-1.0)

The JSP Page:

<html>
<head>
<title>Greetings</title>
</head>
<body>
<%
    for (int i=0; i < 5; i++) out.println("<h1>This is EASY!!!</h1>");
%>
</body>
</html>

This source sent back to the browser looks like :

<html>
<head>
<title>Greetings</title>
</head>
<body>
<h1>This is EASY!!!</h1>
<h1>This is EASY!!!</h1>
<h1>This is EASY!!!</h1>
<h1>This is EASY!!!</h1>
<h1>This is EASY!!!</h1>
</body>
</html>

Who currently supports JSP implementations?
JSP is supported in products such as:

* JRun from Livesoftware (now Allaire) version 2.3.3
* BEA WebLogic Server
* Apache

Where can I get more info?

The JSP Specification can be found at: http://www.javasoft.com/products/jsp/techinfo.html.
An introduction to JSP can be found at: http://java.sun.com/products/jsp/docs.html


New Java Open Enrollment Schedule   - Tempe OCI Education Center

The Tempe OCI Education Center will be releasing a new open enrollment course offering and schedule.  The new program will offer  Java Programming  and Advanced Java Programming on a monthly basis.
For more information call 1-888-962-4624.

JavaBeans Programming  October 25-26 - St. Louis OCI Education Center

An open enrollment offering of the JavaBeans Programming course is scheduled for October 25th and 26th.  The course will be held from 8:30 a.m. - 3:30 p.m.   For more information call Peter Maher, Ph.D. at 314-579-0066 or email training.


Why Java?  here are a few reasons...
Portability -
application logic, user interfaces, database access; ...not perfect portability but much better than other languages.
Support for Web-based Applications - applets for client-side processing; servlets for server-side processing
Built-in support for multi-threading
Built-in support for socket communication
Support of network protocols
Provides multiple ways of creating distributed applications -
sockets, RMI, CORBA, Enterprise Java Beans, Mobile Agents, Servlets and JavaSpaces
Object-Oriented - reuse; maintainability, extensibility
Automatic garbage-collection (memory management)
Productivity -
easier syntax than C++, no need to relink after each code change (speeds debugging)


Object Computing, Inc. is a Sun Authorized Java Center in St. Louis and a Member of the Object Management Group, OMG.  OCI provides Consulting, Education, and Product Development services to clients nation-wide.  For more information email info.

For employment opportunities at OCI call 1-888-962-4624 or email hr.

The Java News Brief is a monthly newsletter.  The purpose and intent of this publication is to advance Java, provide technical value, and to announce available OCI Java services.  If you would prefer to not receive this newsletter or would like to subscribe please email JNB and enter SUBSCRIBE or UNSUBSCRIBE within the Subject line.

Copyright (c) 1999.  Object Computing, Inc.   All rights reserved.   Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries.  Object Computing, Inc. is independent of Sun Microsystems, Inc.