
Be sure you are reading this document through your server (the URL you see must start with http://). Here is a sample application (a Java version of the venerable Pizza sample), so you can test the server-side Java package now. Try it!
Here is a listing of the source code for the sample. Have a look!.
To get started developing your own server-side Java programs with WebSite Pro, complete the following steps:
.;C:\java\lib\classes.zip
Note the . at the beginning, which allows you to compile and test from the current directory (anywhere you want). Also note that the usage display on the Java runner java.exe says that the CLASSPATH should be colon-separated. This is wrong. On Win32, use the usual semicolon-separated path syntax and native pathname (backslash delimiters).
HKEY_LOCAL_MACHINE\Software\Denny\WebServer\CurrentVersion\CGI\
Java ClassPath:REG_SZ: runtime class path
Also, with this mapping you can fetch the classes and HTML documents that accompany the sample applets. Playing with the applet samples is a good way to become familiar with the JDK and with Java itself. Don't worry too much about being an expert applet programmer right away, just dive in and play. Don't do your development work in a directory within the JDK, or all of your work will be web-visible!
The WebSite Professional installation creates an association that couples .clx with the full physical pathname of the javaw.exe program (part of this SDK). The .clx extension stands for class proxy. See the section Java and Windows CGI for information on how these proxy files relate to the actual .class files (Java executables).
"This book is an indispensible quick reference designed to lie flat and wait faithfully by the side of every Java programmer's keyboard. It contains an accelerated introduction to Java for C and C++ programmers who want to learn the language fast."
No kidding. I use this book heavily. It is wonderful. We at O'Reilly are committed to documenting this exciting new technology by developing a series of definitive guides to Java (starting with Java in a Nutshell), as well as incorporating it into our software products such as WebSite Professional.
On NT 3.51, set up 4DOS/NT to run in a console window of 40 lines
height and at least 200 scrollback lines. This makes it possible to see
all of your compilation errors
. On earlier versions of NT and on Windows 95, you
can't set scrollback on console windows. I use the 4DOS list
command to page the output of the compiler (pipe the compiler output to
list) and I have a command alias that does this automatically.
list lets you page up and down in the compiler output. Very
useful. Set up other aliases for things like your editor and the applet
viewer.
Symantec Cafe
Symantec has recently released Symantec Cafe for Windows 95 and NT, an integrated development environment for Java. My personal opinion is that it's wonderful (I use it). It has its own much faster compiler, a language sensitive editor, a graphical class browser, a hierarchy editor, and a fully graphical symbolic debugger. If you haven't used Symantec's IDE (for example, their C++), you're in for a treat. It's similar to the IDE in Visual C++ and has some nice, unique features.
Just-In-Time Compiler
Symantec has also released a companion Just In Time Compiler, a replacement for the Java interpreter engine. The name is somewhat a misnomer. It is not a replacement compiler, it is a replacement interpreter. The name comes from the fact that the "interpreter" saves the machine code that results from bytecode interpretation and actually "peephole optimizes" it, like a smart C or Pascal compiler does. This can result in dramatic speed improvements, up to 10 to 1, over straight bytecode interpretation. The saved machine code is kept for re-use so the interpretation and optimization steps can be skipped after the first run, further increasing speed. Experiments with this technology at Sun showed that speed can be nearly the same as compiled and optimized C/C++.
[email protected]