aspose file tools*
The moose likes Applets and the fly likes An Applet  to contact a different server than it was downloaded from? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "An Applet  to contact a different server than it was downloaded from?" Watch "An Applet  to contact a different server than it was downloaded from?" New topic
Author

An Applet to contact a different server than it was downloaded from?

Michael Remijan
Author
Ranch Hand

Joined: May 29, 2002
Posts: 125
    
    5

I'm toying with the idea of a project that would download an
applet off of one server but that applet would connect to a different
server to get data. I'm pretty sure the SecurityManager will not
allow that applet to do that by default. But I'm thinking a signed
applet can.
I have worked with Java Web Start and know the procedures for
creating signed jar files for that environment. Problem with Web Start
is that it's an all or nothing SecurityManager.
So, I've got a few questions:
(1) is signing an applet done the same way as signing jars for Web Start?
(2) For an applet, where do I put the security.properties file and
tell the browser's JVM to use it?

Thanks Forum,
Michael


Java EE Evangelist — Author, EJB 3 in Action 2nd Edition — Java Community Process Member
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16142
    
  21

I may be out of date here, but applet signing isn't a pretty process. For one thing, the mechanisms for NetScape and IE weren't the same.
Usually I just don't find it worth the trouble. For low-volume stuff, I'd just have the applet tunnel through the server it was loaded from and have that server contact the destination server.
For higher-volume stuff, I'd consider simply having the applet downloaded from the server that it will be talking to. After all, though an unsigned applet is forbidden to talk to a server other than the one it came from, it's a fundamental attribute of HTML that different parts of a web page can (and frequently do) come from more than one server.
A third approach if there's some compelling reason not to keep the applet code on the applet's server would be to have the applet's server proxy for the server that actually contains the applet code.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
wood burning stoves
 
subject: An Applet to contact a different server than it was downloaded from?