• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 290
  • Last Modified:

Applet-Servlet not on the same server.

Is there a way to allow an Applet to call a Servlet which is not on the same server as the Applet by modifying some policy files? (or otherwise)

Thanks in advance,

Llaurick
0
llaurick
Asked:
llaurick
1 Solution
 
sghosh092199Commented:
Basic applets are allowed to connect only to their originating host. It is possible to allow an Applet to call a Servlet on another machine by making changes to the policy file. The policy file java.policy would look like this:

grant {
  permission java.net.SocketPermission "156.65.127.45", "accept, connect, listen, resolve";
};

You will specify this policy file in the Java appletviewer command.
appletviewer -J-Djava.security.policy=java.policy Applet.html

The limitation with this approach is obvious. It can only be used in conjuction with the appletviewer command. So, better options will be Digital Signatures and Certificates.

You can find good help here:
http://java.sun.com/docs/books/tutorial/security1.2/sigcert/index.html

I will try to post some sample programs soon.

Good luck!
0
 
sudhakar_koundinyaCommented:


No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:


-- points to sghosh


Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
sudhakar_koundinya
EE Cleanup Volunteer
---------------------
If you feel that your question was not properly addressed, or that none of the comments received were appropriate answers, please post your concern in THIS thread.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now