[Contents] [Previous] [Next] [Last]

Chapter 7
Deploying and Debugging Applications

This chapter explains how to deploy projects for testing and for delivery, and how to test and debug applications.

Deployment, which includes compilation of Server-side JavaScript as well as installation of your application, is largely automatic with Enterprise Server 3.0. (See "Deploying and Compiling Applications.")

You can test client-side behavior by previewing pages, but to test server-side behavior you must deploy the application, at least locally. The JavaScript Debugger is integrated with Visual JavaScript. (See "Testing and Debugging Applications.")

Deploying and Compiling Applications

When you have completed your application, you must deploy it to the server. When you deploy, the files in your project are copied to the server, and the Application Manager installs the files in the location you specify and registers the application. If your application includes any server-side JavaScript, that code must be compiled on the Enterprise Server. When the application is successfully deployed, your Enterprise Server can access it and serve your pages on demand.

Default deployment information for a project is specified in the project's properties. Display the project in the Inspector to examine or change the properties, which correspond to the values you specify in the Deploy to Server dialog box, shown in Figure 7.1. The values you set in the project properties appear as default values in the dialog box.

NOTE: Two project properties, External Libraries and Max DB Connections, affect few applications and do not appear in the Deploy to Server dialog box. If you need to use these features, set the property values before deploying the application. Refer to the LiveWire documentation for information on these features. §
You can set default deployment preferences to be applied to new projects. (See "Deployment Preferences" for more information.) Values that you set in the project's properties override the preferences.

When you are ready to deploy and compile, click Deploy on the toolbar or choose Deploy Application to Server from the Project menu. The Deploy Project to Server dialog box appears as shown in Figure 7.1, allowing you to specify deployment information.

Figure 7.1    The Deploy Project to Server dialog box

Using the Deployment Dialog Box

Application Name. The project name is used as the application name, and must be different from all other application names on the server. The name is shown in the title bar of the Deploy Project to Server dialog box, and you cannot change it here. If you need to change the name of the application, close this dialog box, rename the project, and re-invoke the dialog box.

Deployment location. This is the location where you want the project files copied for deployment. First, choose the method to be used for transferring the files: HTTP or file copy.

Compile and install project on Enterprise Server 3.0. If you are using Enterprise Server 3.0 or later, select this option to automatically compile and install the application to the server, or automatically compile and restart the server if the application was previously installed.

If you select this option, fill out the rest of the information. Otherwise, click OK, then compile and install the application manually. See "Compiling Applications Using Enterprise Server 2.x."

Important The remote compilation feature is available only if you are using Enterprise Server 3.0 and have previously installed the jsacRemote application to your server. See the Release Notes for instructions on installing this application. If you are using Enterprise Server 3.5 or later, the jsacRemote application may be installed automatically; check the release documentation for the server. If you are using Enterprise Server 2.x, you must manually compile your applications. §
Enterprise server name. This is the hostname of the deployment machine running Enterprise Server 3.x.

Deployment directory on server. This is the path to the deployment location from the server machine.

Default page. The JavaScript runtime engine (part of the server) serves this page if the user does not indicate a specific page in the application. This page is analogous to index.html for a standard URL.

Initial page. The JavaScript runtime engine executes this page when you start the application. This page is executed exactly once per running of the application. It is generally used to initialize values, create locks, and establish database connections. This information is optional.

Client object maintenance. This is the technique for maintaining the client object. This can be client cookie, client URL, server IP, server cookie, or server URL. See "Techniques for Maintaining the Client Object" in Writing Server-Side JavaScript Applications

Check time-stamp on deployment. If you select this option, the system checks the time stamps of existing files at the destination before copying them. If an existing file is newer, it is not overwritten. If you do not select this option, all files are copied and replace any existing versions.

When you have finished specifying values, click OK to deploy the application. A message box appears if the compilation produces errors. When deployment is successful, a dialog box appears in which you can specify whether to run the application immediately, and whether to use debugging options when the application is run. See Getting Started with Netscape JavaScript Debuggerfor information on how to use the Debugger.

To run the deployed application, choose Run from the Project menu, or click Run from Application Manager on the deployment server.

Compiling Applications Using Enterprise Server 2.x

If you are using or deploying on Enterprise Server 2.x, you cannot use the remote compilation feature. You must compile manually and install the application using Application Manager.

Follow these steps to compile and install manually:

  1. Click Deploy on the toolbar.

  2. Specify the Deployment Location in the Deploy Project to Server dialog box, as discussed in the previous section.

  3. Click OK.

    For your convenience, a compilation batch file, build.bat, is deployed along with the project files for use with Netscape Enterprise Server 2.x.

  4. Run the compilation batch file from your deployment location.

    If there are no compilation errors, a .web file appears in the deployment directory.

  5. To install the new application to your server, run Application Manager. On a Windows system, double-click its icon in the LiveWire program group (for Enterprise Server 2.x). Alternatively, load the following URL:
       http://server.domain/appmgr 

  6. Click Add to add a new application.

  7. To run the newly installed application, click Run in Application Manager or load the following URL, using the name you gave the application in Application Manager:
       http://server.domain/appname 
NOTE: See Writing Server-Side JavaScript Applications for information about using Application Manager. §

Testing and Debugging Applications

You can inspect the runtime appearance of a page containing client-side components and test the client-side behavior by previewing the page. Display the page in the Page Editor or select it in the Project Window, then click Preview on the toolbar or choose Preview Page from the File menu. The page appears in a new browser window. To choose a browser for previewing pages, choose Preferences from the Edit menu, click the Editors tab, and set the HTML browser preference. (See "Setting Environmental Preferences" for more information.)

When you preview a page, any server-side code has not yet been compiled, and appears as JavaScript code on the previewed page. To inspect the runtime appearance and test the behavior of a page that contains server-side code, you must deploy it. You can deploy it to your local server for testing, even if you intend to deploy it to a remote server for delivery.

Visual JavaScript includes the Netscape JavaScript Debugger. The debugger feature allows you to debug client-side JavaScript code. In addition, a server-side JavaScript debugger is available with Enterprise Server 3.5. For more information, see the JavaScript Debugger documentation.

To start the debugger with the current page loaded, click Debugger on the toolbar or choose Debug from the Project menu. See Getting Started with Netscape JavaScript Debugger for information on how to use the tool.


[Contents] [Previous] [Next] [Last]

Last Updated: 11/06/97 13:24:54


Copyright © 1997 Netscape Communications Corporation