Mac Java Interface Error Accessing MapServer CGI

Cameron Shorter cameron at socialchange.net.au
Tue Mar 27 06:36:00 EST 2001


Yes, we found this error too, and did a little research.
This is what we found:

=======

<snip>
Looks like you are right, some mac clients cannot have java talk to
javascript - but there is a workaround (although it it a hack).

Java in one window talks to javascript in another window, which talks to
javascript in original window.



http://www.dannyg.com/update4.html
LiveConnect and Navigator 4.6 Navigator 4.6 shipped with a bug that
prevents
       applets from communicating with the document. The indicated error
faults the
       JSObject.class. Unfortunately there is no known workaround for
this bug. As far as I
       can tell, JavaScript-to-applet communication is not bothered by
this bug.

---


http://www.rgagnon.com/ce/java-js.html
Interaction without LiveConnect

Java-Javascript interaction is not possible on many browsers or
platforms. On Mac, for example, the LiveConnect package is not
available, even
with the latest Netscape version. On IE3, the interaction is very
limited too. 

Java to Javascript
One way to pass information from Java to Javascript, without LiveConnect
or scripting support, is to have an hidden frame acting as a bridge.
>From
Java you do a showDocument() with a particuliar page passing the message
as parameter to the hidden frame, something like
showDocument("mypage.html?HelloJavascriptFromJava", "hiddenframe"). The
mypage.html page contains a javascript script to extract the
parameter received in the URL (using the document.search property). And
then the parameter extracted is send to another javascript function in
the
visible frame.
... (example)

Javascript to Java
The idea here is to have an invisible Applet in an invisible frame that
will receive a message (from Javascript in the visible frame) through
the search
part of its URL. Then via a static pointer to the visible Applet, the
invisible Applet pass the message to the visible Applet by calling the
appropriate
function.
... (example)



Michael Kleih wrote:
> 
> Alexspringer at aol.com wrote:
> 
> > A Mac user attempting to access our Mapserver CGI with Java interface, which
> > works fine with IE5 on Windows, fails to connect and gets this error ...
> > anyone know the solution?
> >
> > Incurred while using Internet Explorer 4.5 for Mac using OS 9.1.
> >
> > Java Exception: java.lang.ClassNotFoundException -
> > netscape.javascript.JSObject
> > Stack Trace:
> > java.lang.ClassNotFoundException: netscape.javascript.JSObject
> >  at
> > com.apple.mrj.JManager.JMAppletClassLoader_IMPL.loadClass(JMAppletClassLoaderO
> >
> 
> It seems you are using LiveConnect (connection between JAVA
> and JavaScript), which obviously is not installed on the computer
> of your user. (the class netscape.javascript.JSObject is missing)
> You could give to this user your classfile, your browser is using.
> 
> Michael

-- 
Cameron Shorter          Web Mapping Manager
Social Change Online
248 Johnson St           Tel: +61 (0) 2 9692 5115
Annandale NSW 2038       Fax: +61 (0) 2 9692 5192
Sydney, Australia        http://webmap.socialchange.net.au



More information about the mapserver-users mailing list