Which option is suitable to replace Java Applet?
Asked Answered
K

4

7

I would like to replace Java Applet which currently needs to use client's resources, i.e. external readers, and to communicate with a server via socket.

Reason: 1. I have thousands of client machines using this Java Applet program, and most of them are running out-dated JRE. When the Java Applet program is updated / added new features, all client machines will need updating the latest JRE.

Expected Solution:

The Java Applet program would be expected to be replaced by a web-based application, which allows to compile and run source code at client's side such that the new web-based application could still use client's resources and communicate with server via socket.

Can I use JavaScript to achieve it?

I would very appreciate your help/suggestion for this problem. Thank you!

Keratoplasty answered 5/12, 2013 at 7:58 Comment(4)
What client resources you need to use precisely?Carroll
BTW. You may end up with thousands of clients running out-of-date browsers, and updating your webapp will require you to update all your machines...Carroll
Thanks for your reply el.pescado! Actually, clients are supposed to connected to external smartcard reader, and I've already had C++ DLL library to control the smartcard reader. I expect JavaScript be able to call C++ DLL methods.Keratoplasty
The reason I'd like to replace Java Applet Program because this program has been built years ago and the source code was not well-designed, most of the parts were hard-coded, so it's really painful to do update and maintain it. Moreover, now I have different type of client programs, such as: java applet, Silverlight... in future I would like to migrate them all to web-based application which could be accessed platform- and OS- independently.Keratoplasty
F
1

JavaScript is a scripting language that gets evaluated in the browser. I would not describe it as compiling and running but yes, it does mean you can run code in the client and is commonly used to create applications that run in the browser.

There's a staggering amount of frameworks that you can use to write your application. Take a look at the TodoMVC site to see the same TODO app created using several different frameworks.

If you come from Java applets, GWT may be interesting to look at.

If you wish to let the JavaScript client listen for messages from the server, take a look at websockets.

The smart card reader is going to be a problem, though! See Architectures to access Smart Card from a generic browser? Or: How to bridge the gap from browser to PC/SC stack?


By the way:

The real issue with outdated JREs is not that your code will not run on old JREs, you can create perfectly fine applets using java 1.4 or java 5. Any libraries you may need you can deploy alongside your applet. The pain is a security problem. Anything but the latest version Java plugin is getting actively exploited and puts the user at risk. Occasionally, even the latest version is not safe.

Foreandaft answered 5/12, 2013 at 8:7 Comment(4)
Thanks flup for your advice! I prefer JavaScript to Java Applet because moving-forward most of web browsers would support HTML5 and JavaScript, so it would save a lot of efforts when I need to update a new version. Btw, I've just found an interesting thing, which could probably help me, here it is: github.com/ubinity/webpcsc-firebreathKeratoplasty
To be honest, needing smart card access looks like one of the most compelling reasons around to stay with the current applet. I am not advising you to go for this. I don't know all of the details. If I were to give any advice based on what you write, it would probably be to stick with the applet a little longer.Foreandaft
Yes, you're right! smart card access is the important concern. I will try all solutions with JavaScript before making any decision to migrate. thank you so much for your help!Keratoplasty
"Occasionally, even the latest version is not safe." Even worse than that, occasionally newer versions would reintroduce known security bugs which had previously been solved & fixed! It's no bloody wonder that browser makers decided to drop support for the Java plug-in. Sun/Oracle shot themselves in the foot over this one.Secretin
F
1

In case you want to stick with Java, then one alternative would be to use my http://bck2brwsr.apidesign.org project. It's goal is to create small Java that can run in 100% of modern browsers without any plugin installed.

There are Java bindings to HTML (via knockout - one of the four most popular frameworks for HTML5) and that is why one can code whole business logic in Java and just render it via HTML. Should be enough to replace most of the applet UI.

In addition to that there is an experimental API to render on HTML canvas. People use it to write Java games that run in a pure browser.

There is a simple way to communicate with server via JSON REST API or via WebSockets. A live example is here.

Frants answered 5/12, 2013 at 9:47 Comment(1)
Thanks Jaroslav! But for my issue, smart card access from web browser is the most significant issueKeratoplasty
D
0

try socket.io

I think this is the latest technology you can use to communicate with client browsers. it support the latest browsers and mobile browsers too.

hope this will help you.

Danadanae answered 5/12, 2013 at 8:5 Comment(1)
Thanks Ipis! It's really helpful for socket connecting. I'll try it.Keratoplasty
C
0

Javascript has become very powerful with HTML 5.0. Here is a list of new elements that you can use to access all kinds of resources, including local files, audio, video, GPU rendering (canvas + WebGL) and GPU compute (WebCL). Here are even more things you can do, including database connections and networking. You can even create offline Javascript applications.

jQuery and jQuery layout make robust GUI development a lot easier. Rich tool suites, such as Google Closure offer optimization and a compiler for improving performance and detecting obvious mistakes early in the development process.

W3 offers useful stats for making an informed decision on how many users on average have access to which features. Note that the most annoying guy in that list arguably is IE8 due to it's lack of proper HTML 5.0 support.

Columbuscolumbyne answered 5/12, 2013 at 8:5 Comment(1)
Thanks Domi for sharing with me such useful information! I'll try jQuery UI to make GUI from my future web-based application.Keratoplasty

© 2022 - 2024 — McMap. All rights reserved.