0

As title says I have Java applet that when called from JS/PHP should call an applet function to do something and return a value to PHP/JS. Standalone both of the programs work, say if I create a main class in the java applet it will return the value.

I'm just not sure since these files are in two seperate projects/perspectives in eclipse. Any help is great thanks

user1022570
  • 51
  • 1
  • 3
  • 7
  • Ok well I got some of the applet functionality to work but unfortunately one of the jars that it references seems to not be visible since I receive a ClassNotFoundException for the return value since it throws exceptions – user1022570 Nov 03 '11 at 16:44
  • You asked this same question an hour ago: http://stackoverflow.com/questions/7997170/php-java-eclipse – jprofitt Nov 03 '11 at 16:45

2 Answers2

0

You could let the applet make a HTTP request to your PHP server which tells it what to do, and let it do another request which transports the result. Your javascript code then can communicate with the PHP server using AJAX.

Community
  • 1
  • 1
Yogu
  • 8,033
  • 4
  • 31
  • 51
  • As I got in your first question, javascript doesn't have to communicate with the applet. Then, AJAX isn't even needed. Just start the HTTP request out of your applet. – Yogu Nov 03 '11 at 16:55
0

It is also possible to call the applet in the webpage through JS with parameters and make it call a JS function when it finishes its computing. If thats what you are looking for I suggest you do some research regarding the "MAYSCRIPT" option in applets as well as how to pass parameters to the applet. Let me know if you still have questions regarding this process.

Cheers, Lukas Rezek

SuperTron
  • 3,963
  • 6
  • 31
  • 60