Java servelets work by implementing a new Netscape server object type called wjava.
Instead of accessing a CGI program, your form will request a file with the extension wjava. It does not matter what the file contains, but it must exist for the Netscape server to carry out authentication checks.
Create a file with the extension .wjava somewhere in your Server docs tree, for example
C:/netscape/Server/docs/ext/service.wjava
This file must exist and be readable for permission checks. Whenever this file is accessed, your extension DLL will run.
The "Starbuck" Java Plugin does the following:
Note that "Starbuck" must be loaded on your Web Server system, so that interface DLLs can be accessed.
"Starbuck" comes with two interface DLLs.
javansapi.dll is the Netscape Plugin that will run your Java servelet.
wwwconnect.dll is a DLL that allows your Java servelet to communicate
with the Web Server.
Update the Netscape configuration file in config/obj.conf. Use caution, this file must be correct or the server will not restart. Follow these steps:
Init fn="load-modules" shlib="C:/Powersoft/Starbuck/system/javansapi.dll" funcs="wjava-fn,wjava-ntrans"Note: Netscape 2.x servers require a quoted list of function names, while Netscape 1.x servers did not. Also, Netscape recommends slashes instead of backslashes in filenames. Use the correct pathname to the "Starbuck" System/javansapi.dll file.
NameTrans fn=wjava-ntrans
<Object name=wjava> Service fn=wjava-fn </Object>
Note: once Netscape has loaded a DLL, the DLL file cannot be copied over, until you shutdown Netscape again.
localhost/service.wjava?class=your_JAVA_class
Note that you must have your class files in the Classpath directory list that the Microsoft Java VM uses to find class files. You can edit your Classpath with the registry. Change the setting of Classpath under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Java VM
If you need to do more work on your code, remember to shutdown and restart the server after you have updated your DLL. Netscape Server loads javansapi.dll at startup, and never unloads it. In turn, javansapi.dll loads (and never unloads) the Microsoft Java VM, which in turn keeps any previously loaded .class files in memory for faster subsequent access.
You can specify a classpath in your URL. If provided, you can use the following syntax: