0

I am trying to use Jwrapper to replace the java applet as chrome is blocking the Java applet. So please suggest the best way to integrate the Jwarpper app in javascript and best way to deploy.

Regards, Mukesh Gupta

1 Answers1

0

When you build an app using JWrapper it will produce, amongst other files:

MyAppNameEmbed.js
MyAppNameExample.html

You can copy all the files in the build directory including the ones above and make them available on a web server / website.

You can then take the URL of the JS file above, and use the code in the example HTML file above to point it to your JS file. For example:

<script
   id = "jwEmbed"
   src = "http://www.example.com/myappname/MyAppNameEmbed.js"
   showImage = "yes"
   showAppName = "yes"
   configuration = "offline*"
   type = "text/javascript">
</script>

You can get the exact HTML code to use from your example HTML file in your build folder. This will create a block in your web page which autodetects the end user operating system and provides an appropriate download button which then links to the executable app files you uploaded (along with the JS and HTML files) to your website.

AntonyM
  • 1,602
  • 12
  • 12
  • I had done this. but i am not able to call method in the Jwrapper app from the javascript. – Mukesh Gupta Jul 17 '15 at 03:59
  • I'm not sure what you mean about calling the method from javascript? Do you mean you don't know what URL to use to specify the javascript? The idea with this code and deployment isn't that the javascript has the ability to just launch the Java - that is a facility that is disappearing across browsers - its that it provides you with a way to get an app to the user and easily embed it into the browser? – AntonyM Jul 17 '15 at 09:35
  • Let me explain more.... i have a applet which has a method to return macaddress of the pc. and using javascript i call that method and that i am able to get the mac address of the pc in the web application. now because applet is going to be blocked in chrome so i am trying to jwrapper for this. – Mukesh Gupta Jul 17 '15 at 13:20
  • Ok thanks for explaining, JWrapper doesn't directly replace applets in that way, instead it is an alternative method of easily delivering Java based apps to end users, and it also has some features which allow you to parameterise the app for each download. It looks like you are looking for something more like a browser plugin. As far as I am aware you won't be able to do that these days in Java. You may have some luck with FireBreath.org (C++ I think?) but you may find it particularly difficult to do in Chrome since they disabled NPAPI plugins recently. – AntonyM Jul 17 '15 at 18:26