.webfile). (See "Compiling an Application" on page 56.) Compile Java source files into class files.
/world/. You can also debug the application by clicking Debug in the Application Manager. (See "Debugging an Application" on page 65.)
http://In response, the Application Manager displays the page shown in Figure 3.2.
Figure 3.2 Application Manager
Clientobject maintenance technique
jsac [-h] [-c] [-v] [-d] [-l]Items enclosed in square brackets are optional. The syntax is shown on multiple lines for clarity. The
[funct1.js ... functN.js]
-) or the forward slash (
/) to indicate a command-line option. That is, the following lines are equivalent:
jsac -hNote that because the forward slash indicates a command-line option, an input file cannot start with a forward slash to indicate that it is an absolute pathname. That is, the following call is illegal:
jsac -o myapp.web /usr/vpg/myapp.htmlThis restriction does not apply to any of the pathnames you supply as arguments to command-line options; only to the input files. On NT, you can instead use backslash (
\) to indicate an absolute pathname in an input file, as in the following call:
jsac -o myapp.web \usr\vpg\myapp.htmlOn Unix, you must use the
-icommand-line option to specify an absolute pathname, as described below. The following command-line options are available:
-h: Displays compiler syntax help. If you supply this option, don't use any other options.
-c: Checks syntax only; does not generate a web file. If you supply this option, you do not need to supply the
-v: (Verbose) Displays information about the running of the compiler.
-l: Specifies the character set to use when compiling (such as
outfile: Creates a bytecode-format web file, named
outfile.web. If you do not supply this option, the compiler does not generate a web file. (Omit this option only if you're using the
-coption to check syntax or
-hto get help.)
inputFile: Allows you to specify an input file using its full pathname instead of a relative pathname. You can provide only one filename to this option. If you need to specify multiple filenames using full pathnames, use the
pathName: Specifies a directory to be the root of all relative pathnames used during compilation. (Use before the
-foption.) You can provide only one pathname to this option.
includeFile: Specifies a file that is actually a list of input files, allowing you to circumvent the character limit for a command line. You can provide only one filename to this option. The list of input files in
includeFileis white-space delimited. If a filename contains a space, you must enclose the filename in double quotes.
errorFile: Redirects standard output (including error messages) to the specified file. You can provide only one filename to this option.
-a 1.2: Changes how the compiler handles comparison operators on the server. For more information, see "Comparison Operators" on page 201.
support.js, creating a binary executable named
myapp.web. In addition, during compilation, the compiler prints progress information to the command line.
jsac -v -o myapp.web main.html hello.html support.jsAs a second example, the following command compiles the files listed in the file
looksee.txtinto a binary executable called
jsac -f looksee.txt -o looksee.webHere,
looksee.txtmight contain the following:
Figure 3.3 Add Application form
/world. This is a required field, and the name you type must be different from all other application names on the server. See "Application URLs" on page 61.
c:\nshome, the web file path for the Hello World application is
index.htmlfor a standard URL.
clientobjects. This is an optional field.
clientobject. This can be client cookie, client URL, server IP, server cookie, or server URL. See "Techniques for Maintaining the client Object" on page 253.
http://server.domain/appNameHere, server is the name of the HTTP server, domain is the Internet domain (including any subdomains), and appName is the application name you enter when you install it. Individual pages within the application are accessed by application URLs of the form
http://server.domain/appName/page.htmlHere, page is the name of a page in the application. For example, if your server is named
coyoteand your domain name is
royalairways.com,the base application URL for the
hangmansample application is
http://coyote.royalairways.com/hangmanWhen a client requests this URL, the server generates HTML for the default page in the application and sends it to the client. The application URL for the winning page in this application is
http://coyote.royalairways.com/hangmanIn this case, the runtime engine on the server looks for a document in the
NOTE: Controlling access to applications with configuration styles is available only with Netscape 2.0 servers and later versions.
http://server.domain/appmgr/control.html?name=appName&cmd=startHere, appName is the application name. You cannot use this URL unless you have access privileges for the Application Manager. If you want to stop an application and thereby make it inaccessible to users, select the application name in the Application Manager and click Stop. The application's status changes to Stopped and clients can no longer run the application. You must stop an application if you want to move the web file or update an application from a development server to a deployment server. You can also stop an application by loading the following URL:
http://server.domain/appmgr/control.html?name=appName&cmd=stopHere, appName is the application name. You cannot use this URL unless you have access privileges for the Application Manager. You must restart an application each time you rebuild it. To restart an active application, select it in the Application Manager and click Restart. Restarting essentially reinstalls the application; the software looks for the specified web file. If there is not a valid web file, then the Application Manager generates an error. You can also restart an application by loading the following URL:
http://server.domain/appmgr/control.html?name=appName&cmd=restartHere, appName is the application name. You cannot use this URL unless you have access privileges for the Application Manager.
clientobjects, before and after generating HTML for the page
Figure 3.4 Debugging Hangman
http://server.domain/appmgr/trace.html?name=appNameHere, appName is the name of the application. To display the trace utility in the same window as the application (but in a separate frame), enter this URL:
http://server.domain/appmgr/debug.html?name=appNameYou cannot use these two URLs unless you have access privileges to run the Application Manager. You may want to bookmark the debug URL for convenience during development.
debugfunction displays values to the application trace utility. For example, the following statement displays the value of the
guessproperty of the
requestobject in the trace window along with some identifying text:
debug ("Current Guess is ", request.guess);
NOTE: In general, for security reasons, you should not deploy source files.Depending on the application, you might want to restrict access to certain groups or individuals. In some cases, you might want anyone to be able to run the application; in these cases you don't need to apply any restrictions at all. If the application displays sensitive information or provides access to the server file system, you should restrict access to authorized users who have the proper user name and password. You restrict access to an application by applying a server configuration style from your Server Manager. For information on using Server Manager and configuration styles, see the administrator's guide for your web server.
$NSHOMEis the directory in which you installed the server and serverID is the server's ID. In case of catastrophic errors, you may need to edit this file yourself. In general, this is not recommended, but the information is provided here for troubleshooting purposes. Each line in
jsa.confcorresponds to an application. The first item on each line is the application name. The remaining items are in the format
nameis the name of the installation field, and
valueis its value. The possible values for
uri: the application name portion of the base application URL
object: path to the application web file
home: application default page
start: application initial page
maxdbconnect: default maximum number of database connections allowed for the predefined
library: paths to external libraries, separated by commas or semicolons
client-mode: technique for maintaining the
jsa.conffile is limited to 1024 lines, and each line is limited to 1024 characters. If the fields entered in the Application Manager cause a line to exceed this limit, the line is truncated. This usually results in loss of the last item, external library files. If this occurs, reduce the number of external libraries entered for the application, and add the libraries to other applications. Because installed libraries are accessible to all applications, the application can still use them. A line that starts with # indicates a comment. That entire line is ignored. You can also include empty lines in the file. Do not include multiple lines specifying the same application name. Doing so causes errors in the Application Manager.
Last Updated: 11/12/98 15:29:10