aspose file tools*
The moose likes Applets and the fly likes How to invoke client side applets from a server side web application? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "How to invoke client side applets from a server side web application?" Watch "How to invoke client side applets from a server side web application?" New topic
Author

How to invoke client side applets from a server side web application?

Vincent Paranpan
Greenhorn

Joined: Sep 16, 2010
Posts: 13
Hi guys,

I don't know if I'm in the right thread to post this but I figured that I should post it here since my question it involves Web technologies (HTML, JavaScript, JSP and such), but on the other hand maybe I'm supposed to post this in the Applet thread?..

Anyways, my question is...

How do I invoke client side applets from a web application? (Servlets)

Thanks,
Vince
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
Generally, you can't. The applet needs to make contact with the server. What specific problem are you trying to solve?
Vincent Paranpan
Greenhorn

Joined: Sep 16, 2010
Posts: 13
Hi Lester,

Thanks for the quick reply, you see I've tried doing this with ActiveX and it works,
but our requirements changed so I no longer have the option to use IE as my web browser.

What other options could I use to replicate the behavior of ActiveX on other web browsers like Firefox and Google Chrome, any suggestions?

Thanks again,
Vincent
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
ActiveX is a technology that allows you to run just about every code you want in an IE browser instance, generally without much in the way of security. If that's acceptable, then you can sign the applet and have it execute any code you want, including one that opens a ServerSocket and listens for incoming HTTP requests.

The difficulty, though, is how the web server will get to know the IP address of the browser - how did that work with whatever ActiveX control you were using? And, of course, the client machine -and any firewall in between client and server- must allow incoming connections.
Vincent Paranpan
Greenhorn

Joined: Sep 16, 2010
Posts: 13
I see, so If I embed a signed applet and use ServerSocket I'll be able to invoke applications (executable JAR for example) from the client side?

Here's the code I used back then when we were still testing ActiveX and when we were allowed to use IE:



As you can see I created a simple (just for testing) function call to a javascript just to invoke the JAR placed on the client side.

Thanks,
Vincent
 
wood burning stoves
 
subject: How to invoke client side applets from a server side web application?