[2686] in java-interest

home help back first fref pref prev next nref lref last post

Re: native methods display

daemon@ATHENA.MIT.EDU (Thomas Ball)
Tue Oct 10 17:33:54 1995

Date: Tue, 10 Oct 1995 12:35:11 -0700
From: Thomas.Ball@Eng.Sun.COM (Thomas Ball)
To: julio@Vantive.COM
Cc: java-interest@java.Eng.Sun.COM

You cannot access a local database using its API with a Java *applet*,
but you can with a Java *program*.  Instead of subclassing from class
Applet, define a "public static void main(String argv[])" method as
your main routine.  Use java to run this class, instead of the
appletviewer or a Java-enabled browser.  This program can't be embedded
in a web page using the APPLET tag, but then it would be useless to
remote viewers anyway since they wouldn't have your local database on
their machine.

To make your database public on the web, you need to write a server
program which either: 1) acts as an Internet server (like the FTP, HTTP,
and SMTP daemons), listening on a well-known port for clients, or 2) a
helper program which talks to the HTTP server, using the CGI protocol.
Writing a Java applet which talks to this server is legal.

Tom

>  Can you please clarify your response? Let me ask it in another way.
>  Would I be able to create an applet that as part of its task is to
>  open and modify a local (to the machine running the browser/applet) db
>  via the database's provided API?
>  
>  ** julio
>  
>  > We explicitly prevent applets from loading DLLs for security reasons.
>  > Imagine loading the Visual Basic for Applications DLL (available on
>  > all systems running the latest Microsoft Office products, such as
>  > Word or Excel) and passing it a virus or malicious program written in 
>  > Basic.  (It may be difficult writing good stuff in Basic, but it's 
>  > perfect for this. :-)
>  
>  >>  
>  >>  
>  >>  I am trying to use native methods mechanism to control the behavior of an 
>  >>  applet from windows dll. Things work fine if I do not call any UI functions 
>  >>  from the dll. But if I call a function such as AfxMessageBox() from 
>  >>  DllMain() to display windows message box the dll fails to load and I get 
>  >>  UnsatisfiedLinkException. The same function works fine if I load dll from 
>  >>  other Windows application (other that hotjava).
>  >>  
>  >>  Is it legal for the native dlls that get loaded from hotjava applet, to 
>  >>  display dialog boxes etc? (I am running Alpha3 on NT 3.51)
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post