Next | Index

Server-Side JavaScript Guide

This book explains how to use core and server-side JavaScript for version 1.4. JavaScript is Netscape's cross-platform, object-based scripting language for client and server applications.

Contents

Getting Started

What's New in this Release
Support for JavaScript 1.4
Changes to the JavaScript Application Manager
What You Should Already Know
JavaScript Versions
Where to Find JavaScript Information
Upgrading from an Earlier Release
Backward Compatibility with Earlier Releases
Document Conventions

Chapter 1  JavaScript Overview

What Is JavaScript?
Core, Client-Side, and Server-Side JavaScript
Core JavaScript
Client-Side JavaScript
Server-Side JavaScript
JavaScript and Java
Debugging JavaScript
Visual JavaScript
JavaScript and the ECMA Specification
Relationship Between JavaScript and ECMA Versions
JavaScript Documentation vs. the ECMA Specification
JavaScript and ECMA Terminology

Part 1 Developing Server Applications

Chapter 2  Getting Started

Architecture of JavaScript Applications
System Requirements
Configuration Information
Enabling Server-Side JavaScript
Protecting the Application Manager
Setting Up for LiveConnect
Locating the Compiler

Chapter 3  Mechanics of Developing JavaScript Applications

Basic Steps in Building an Application
JavaScript Application Manager Overview
Creating Application Source Files
Compiling an Application
Installing a New Application
Application URLs
Controlling Access to an Application
Modifying an Application
Removing an Application
Starting, Stopping, and Restarting an Application
Running an Application
Debugging an Application
Using the Application Manager for Debugging
Using Debug URLs
Using the debug Function
Deploying an Application
Application Manager Details
Configuring Default Settings
Under the Hood

Part 2 Server-Side JavaScript Features

Chapter 4  Quick Start with the Sample Applications

About Server-Side JavaScript Sample Applications
Hello World
What Hello World Does
Looking at the Source Script
Modifying Hello World
Hangman
Looking at the Source Files
Debugging Hangman

Chapter 5  Basics of Server-Side JavaScript

What to Do Where
Overview of Runtime Processing
Server-Side Language Overview
Prototypes
Usage
Environment
Classes and Objects
Embedding JavaScript in HTML
The SERVER tag
Backquotes
When to Use Each Technique
Runtime Processing on the Server
Constructing the HTML Page
Generating HTML
Flushing the Output Buffer
Changing to a New Client Request
Accessing CGI Variables
Communicating Between Server and Client
Sending Values from Client to Server
Sending Values from Server to Client
Using Cookies
Garbage Collection
Error Handling in Server-Side JavaScript

Chapter 6  Session Management Service

Overview of the Predefined Objects
The request Object
Properties
Working with Image Maps
The client Object
Properties
Uniquely Referring to the client Object
Creating a Custom client Object
The project Object
Properties
Sharing the project Object
The server Object
Properties
Sharing the server Object
Techniques for Maintaining the client Object
Comparing Client-Maintenance Techniques
Client-Side Techniques
Server-Side Techniques
The Lifetime of the client Object
Manually Appending client Properties to URLs
Sharing Objects Safely with Locking
Using Instances of Lock
Special Locks for project and server Objects
Avoiding Deadlock

Chapter 7  Other JavaScript Functionality

Mail Service
File System Service
Security Considerations
Creating a File Object
Opening and Closing a File
Locking Files
Working with Files
Example
Working with External Libraries
Guidelines for Writing Native Functions
Identifying Library Files
Registering Native Functions
Using Native Functions in JavaScript
Request and Response Manipulation
Request Header
Request Body
Response Header

Part 3 LiveWire Database Service

Chapter 8  Connecting to a Database

Interactions with Databases
Approaches to Connecting
Database Connection Pools
Single-Threaded and Multithreaded Databases
Guidelines
Managing Connection Pools
Sharing a Fixed Set of Connection Pools
Sharing an Array of Connection Pools
Individual Database Connections
Maintaining a Connection Across Requests
Waiting for a Connection
Retrieving an Idle Connection

Chapter 9  Working with a Database

Interacting with a Relational Database
Automatically Displaying Query Results
Executing Arbitrary SQL Statements
Manipulating Query Results with Cursors
Creating a Cursor
Displaying Record Values
Displaying Expressions and Aggregate Functions
Navigating with Cursors
Working with Columns
Changing Database Information
Managing Transactions
Using the Transaction-Control Methods
Working with Binary Data
Calling Stored Procedures
Exchanging Information
Steps for Using Stored Procedures
Registering the Stored Procedure
Defining a Prototype for a Stored Procedure
Executing the Stored Procedure
Working with Result Sets
Working with Return Values
Working with Output Parameters
Informix and Sybase Exceptions

Chapter 10  Configuring Your Database

About LiveWire Database Service
Checking Your Database Configuration
Supported Database Clients and ODBC Drivers
DB2
Informix
Informix Remote
Informix Local
ODBC
ODBC Data Source Names (NT only)
OpenLink ODBC Driver (Solaris only)
Visigenic ODBC Driver (Unix only)
Oracle
Oracle Remote
Oracle Local
Sybase
Sybase Remote
Sybase Local
Sybase (Unix only)

Chapter 11  Data Type Conversion

About Data Type Conversion
Working with Dates and Databases
Data-Type Conversion by Database

Chapter 12  Error Handling for LiveWire

Checking for Error Conditions
Return Values
Number
Object
Boolean
String
Void
Error Methods
Status Codes

Chapter 13  Videoapp and Oldvideo Sample Applications

About Videoapp and Oldvideo Sample Applications
Configuring Your Environment
Connecting to the Database and Recompiling
Creating the Database
Running Videoapp
Looking at the Source Files
Application Architecture
Modifying videoapp

Part 4 Working with LiveConnect

Chapter 14  LiveConnect Overview

What Is LiveConnect?
Working with Wrappers
JavaScript to Java Communication
The Packages Object
Working with Java Arrays
Package and Class References
Arguments of Type char
Example of JavaScript Calling Java
Java to JavaScript Communication
Using the LiveConnect Classes
Accessing Server-Side JavaScript
Data Type Conversions
JavaScript to Java Conversions
Java to JavaScript Conversions

Glossary

Index


Next | Index

Last Updated: 09/29/99 18:01:47

© Copyright 1999 Sun Microsystems, Inc. Some preexisting portions Copyright 1999 Netscape Communications Corp. All rights reserved.