• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Run applet from remote machine

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a web application, that I want to run from a remote machine. (by giving the server's IP: http://server-IP:8080/myApp).

I want to run applet from myApp.
When I did it locally (server & client on the same machine), I had to change the java.policy, and put the required jars in the jre/lib/ext.

Now, I want to run the applet from a remote computer without having to change the java.policy or put the jars manually.

What is the way to do it??

Thanks a lot,
Efrat
 
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You first problem can be solved in 2 different ways.

1. You can add stuff to the first jars manifest
2. You should put the jars in the classpath using the originating HTML page.

Useful links:
Question about this on another forum!

Jar files revealed! (look into jar-indexing)

The second link also tells you about jar security which is also useful for your second issue. If you do not want to deal with policy issues you can sign your applet and allow it access to your system.
 
Efrat Bar-Nahum
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Manuel,

I didn't understand the manifest part.
Can I add the other jars (the ones that are located in lib/ext) to the manifest of my web-application's jar?
What is the way to do it? (I couldn't understand from the links that you sent me.)

Thanks a lot,
Efrat
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no need to put anything into the ext directory, or fiddle around with manifests. Put all jar files on the remote server, and reference them in the archive attribute of the applet tag. More information on that can be found here.

Also, the policy file only needs to be changed if the applet does something that's not normally allowed (like file I/O). Otherwise, don't change it.
[ September 14, 2006: Message edited by: Ulf Dittmer ]
 
Manuel Moons
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Like I said before! There are two ways of handling your first issue. Referencing via the manifest (which is a bit more complex, I agree) or adding stuff to the classpath via the archive attribute (in the html page). Maybe it is best if you use the second alternative like Ulf said. So follow his link and you will be able to fix your problem.

Ulf also has a point when he says that no policy file editing is necessary when no IO tasks are done (or other secure tasks). I assumed however that you altered your policy file because of security issues. Maybe the following link is useful for you to determine whether or not you need to do this.

Applet security

One important thing I would like to mention is this: The classes that your web application can/may use have nothing to do with the classes that the applet use. The web application is running in a different virtual machine than the applet. The applet is running on the client that is accessing the web application. The only thing the webserver does is allow the applets' jars to be downloaded to the client. The applets'jars are not included in the classpath of the server. This means that there is nothing you can do in the lib/ext folder of the webapp that will have any result on the applets'classpath.
So if your applet and webserver share classes you will have to put those classes in the applets'jars (classpath) AND in the web-apps'classpath.
 
Efrat Bar-Nahum
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I handled the first issue by putting the jars in the server side and referencing them from the applet tags.
Now I'll move to the second issue - the security...

Thanks a lot,
Efrat
 
I have always wanted to have a neighbor just like you - Fred Rogers. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic