views:

99

answers:

2

I'm trying to set up an application server to run a simple website and a Java client application that needs to communicate back to a Java server.

What I'd like to do is the following:

Will this work given the Java security model? Or is there a better design?

+1  A: 

For your Applet to be able to communicate to anywhere else than where it was downloaded from you are going to need to sign it, or forward any requests from it from where it was sent from.

Romain Hippeau
Thanks - but does that apply if all the "sites" are subdomains of the same overall site, e.g. mydomain.com?
mikera
@mikera - see here http://java.sun.com/docs/books/tutorial/deployment/applet/security.html
Romain Hippeau
@mikera - The rules for JNLP are somewhat different.
Romain Hippeau
Thanks romain - however the linked document is still ambiguous as far as I can tell as to whether it will allow an applet from a.mydomain.com to access a server at b.mydomain.com - any ideas on this?
mikera
@mikera - If you have doubt, try it.
Romain Hippeau
@mikera - How is this ambiguous - They can make network connections to the host they came from.
Romain Hippeau
It's ambiguous because it doesn't define what it means by host - IP address? domain name? subdomain? virtual host? I clearly could go and spend a day or two building different server configurations and testing all the combinations but I would have thought that it should be defined somewhere....
mikera
+2  A: 

better way is to manage your configuration under only one domain

* Website/web application server at http://www.mydomain.com
* Applet and/or Java Web Start jar at http://www.mydomain.com/files
* Server listening on some port at http://www.mydomain.server.com

You can use method of authentication for file access

sagar