Java URL Poller Sample
(with NSAPI on Netscape Enterprise Server)
This sample implements a URL poller. The server will keep track of a list of URLs that will be periodically
polled to see if their contents have been changed since the last (saved) modified date.
This file contains instructions for running this sample with the Netscape Enterprise Server. For instructions on
running the sample with either the Microsoft Internet Information Server or the Microsoft Personal Web
Server, please refer to the file IURL_Poller.html. This file will only provide the instructions to run this
sample. For a more detailed explanation of the components, please refer to the file NetscapeInstall.html.
Click here for installation instructions.
To run this sample on your machine, you will need to install the following components:
- Netscape Enterprise Server
- Microsoft Java VM
Server Side Instructions
To configure the Netscape Enterprise Server
- Go to your \Netscape\Server\docs directory
- Create a file named service.wjava and add these statements to it:
<HTML>
<HEAD>
<TITLE>Optima++ Java Netscape Service Placeholder</TITLE>
</HEAD>
<BODY>
<BLOCKQUOTE>
<FONT SIZE=+3>P</FONT><FONT SIZE=+1>laceholder for Optima++ Java
support. If you see this file on your browser, you have not installed
or setup the JAVANSAPI.DLL properly.
</BODY>
</HTML>
- Save service.wjava and close the file
- Go to your \Netscape\Server\https-serverName\config directory, where serverName is the
name of your Netscape Enterprise Server.
For example: d:\Netscape\Server\https-mnguyen\config
- Open the file obj.conf.
- Add this line after the last Init fn= statement (all on 1 line, without newlines):
Init fn="load-modules" shlib="%Starbuck%/system/javansapi.dll"
funcs="wjava-fn,wjava-ntrans"
where %Starbuck% is the directory where Starbuck is installed
For example:
Init fn="load-modules" shlib="d:/starbuck20/system/javansapi.dll"
funcs="wjava-fn,wjava-ntrans"
- Add this line after the <Object name="default"> statement:
NameTrans fn=wjava-ntrans
- Add these lines after </Object> statement that closes the <Object name="default">
section: <Object name=wjava>
Service fn=wjava-fn
</Object>
- Save obj.conf and restart your Netscape Enterprise Server
The classpath field is the path to the Java class files for this sample. If you run this sample from Starbuck,
Starbuck will copy the class files and this html file to your \Netscape\Server\docs\NURL_Poller
directory. From your HTML editor, modify the classpath field to point to your
\Netscape\Server\docs\NURL_Poller directory
Client Side Instructions
To run this sample from Starbuck
- Start the Netscape Enterprise Server
- Start Starbuck
- Open this sample project: IURL_Poller.wxp
- From the View menu of the main Starbuck menu bar, click Targets
- In the Targets window, use the right button to click on NURL_PollerWebApp. Then choose Run
Options
- On the General page, click Publish, then run a web browser
- Click Configure and choose your Web browser
- Click on the Initial URL for the browser box and type in the following URL:
http://localhost/NURL_Poller/NURL_Poller.html
- Click OK
- Click the Publish tab. On the Publish page, click Copy the files to a folder
- Click in the Folder box and type the path to your \Netscape\Server\docs\NURL_Poller directory
For example: d:\Netscape\Server\docs\NURL_Poller\
- Click OK to finish
- To run this sample, from the Run menu of the main Starbuck menu bar, click Run
- In the Default Program window, click on NURL_PollerWebApp and click OK
- Wait for your Web browser to load this file
- If you wish to add a URL to the list, in the Polling Information Submission Form, click on the Add
URL box and then type the URL you want to add
- If you wish to simply see a list of the current URLs being stored, leave the Add URL box blank.
- If you wish to change the polling interval, click on the Polling Interval box and type the number of
minutes
- Click on View URLs to optionally add a new URL and to view the URL list
To run this sample from outside Starbuck
- Make sure that this html file and the class files for this project are copied to your
\Netscape\Server\docs\NURL_Poller directory. The class files for this project are located in
\%Starbuck%\samples\IURL_Poller\Debug directory, where %Starbuck% is the directory where
you installed Starbuck
- Start the Netscape Enterprise Server
- Start your Web browser and type in the following URL:
http://localhost/NURL_Poller/NURL_Poller.html
- If you wish to add a URL to the list, in the Polling Information Submission Form, click on the Add
URL box and then type the URL you want to add
- If you wish to simply see a list of the current URLs being stored, leave the Add URL box blank.
- If you wish to change the polling interval, click on the Polling Interval box and type the number of
minutes
- Click on View URLs to optionally add a new URL and to view the URL list