9

We developed several web applications for different customers, from simple kind-of-boring-looking CRUD-style GUIs for those poor admin guys to fancy-schmancy AJAX-enhanced GUIs for those Internet people. All of these were based on JSF 1.2 in combination with JBoss Seam 2, using Facelets and RichFaces as presentation layer.

We do know about the limitations of JSF 1.2 and (I'm feeling sad about that) we have not yet managed the transition to Java EE 6, but with defining this setup as our technology stack, we gained some experience with that technology, feeling comfortable to reliably develop web applications for our customers.

So, why the heck do I tell you that? Because we experience more and more that customers who heard of "Web 2.0" want to have rich client functionality while only accepting a browser as their door to all applications. Allthough we know that one can do that with the technology we use, we feel, that it might be a good idea to use something different on the client side to support those needs. And since we are mostly Java programmers and we keep shooing away this one guy bugging us with his Adobe Flex, we think, that JavaFX in its new version might be a good thing to go with.

I made my hands aching digging into the deep of the JavaFX resources I could manage to find - but one thing which came to my mind quite often was that JavaFX presents itself as a technology that is able to do some nice graphical effects, but while bouncing colored shaded bubbles might look cool, they are basically useless in business applications.

Well, to make a long story short - we like to use Java EE 6 in the backend while having rich and nice looking functionality on the client. Is JavaFX a good alternative here to the classic web pages or even to the upcoming modern HTML 5 webpages when developing business web applications and where can one find examples for that?

Thanks for your time reading this and for the answers which hopefully arise.

2
  • I think it's more of an alternative for "classic Swing or .NET forms applications".
    – Thilo
    Dec 21, 2011 at 8:35
  • Of course it's an alternative (even more so today). It's not an optimal alternative for SIMPLE web use-cases, especially where deployment is very complex (hint: usually with "enterprise", due to internal controls, deployment is relatively easy). But for complex use cases or highly standardized environments it's certainly usable. Flex was great (the best, easily) back in the day (and easy to learn for Java devs...), until Apple lies ruined Flash, so in hindsight looking at FX was a good call-- built into JDK now...
    – User
    Sep 9, 2016 at 21:14

3 Answers 3

11

I'd go for HTML 5, unless I had some needs a web app couldn't satisfy.

I'm certain you can build great apps with JavaFX, but there is very little tooling, except for the standard Java stuff. And since it's not very widely used, you'll have trouble finding support, and hiring people who are good at it. There's also always the risk of it going the same way as its .Net counterpart Silverlight - to the trash can (Oracle aren't sentimental). As for Flex, Adobe just donated Flex to Apache with the explanation that HTML 5 is the "best technology for enterprise application development".

Compare this with HTML 5. It's not only more widely used (which means you'll be able to find support and have an easier time recruiting), but it also gains more support, better tooling and new features continually. I think it's rather obvious which is more future proof.

4
  • 1
    Yes, I also thought about just using HTML 5 for the same reasons you are talking about. I haven't had a deep look into it yet - but since HTML 5 still is a markup language and not a programming language - what is it then you are actually using for client code development - JavaScript with lots of frameworks on top? Dec 21, 2011 at 9:10
  • 1
    Yes, Javascript and jQuery are sort of the standard for the client side web programming. Most Java web frameworks (including JSF) can generate a lot of Javascript to help you out, if you really don't want to write JS.
    – gustafc
    Dec 21, 2011 at 9:30
  • Not an answer to the question, this is a sales pitch. You web guys are shameless. Stop trying to "kill" other technologies and stay in your own semi-functional fragmented sandbox, please.
    – User
    Sep 9, 2016 at 21:07
  • 1
    @Manius "No" is a perfectly valid answer to "is X a good alternative to Y". But thanks for calling this Q to my attention, it should be closed as off topic. "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam."
    – gustafc
    Sep 11, 2016 at 18:45
10

You may want to take a look at DataApp sample from JavaFX Samples bundle at http://www.oracle.com/technetwork/java/javafx/downloads/index.html

It's an example of the enterprise application with JavaFX UI in Browser. It will give you a good example of that can be made on JavaFX for enterprise clients.

You may need to invest some time into installing MySQL, EE and stuff for this sample (quite easy, just follow provided README), but you will see how full stack is handled from DB to client UI.

Small screenshot of the first screen:

DataApp Sample

2
  • Thanks for the hint - I already had that downloaded, but since the DataApp is only in src folder, I hadn't spotted it. Dec 22, 2011 at 8:32
  • I think it's a good start, so I accept this one, allthough I would like to know, if one can have a tighter, framework-supported way to exchange data and invoke actions like I am used to with JSF and not only going via REST webservices. Dec 23, 2011 at 10:08
5

Most examples of "the enterprise side" of JavaFX you'll find will be a JavaFX client talking to the back end through a RESTful webservice.

But, Java Web Start is a cool technology. With it you will have an application client launched through your web site, automatically updated to the latest version and with all new dependencies automatically downloaded from the server. You can even do dependency injection and inject a client local proxy to server side resources; Enterprise JavaBeans, JMS administered objects et cetera.

This is a really useful technology, one that will let your client talk with the server in a numerous amount of ways and not only use HTTP wired web services. However, JavaFX brake that pattern. There isn't a straight forward way to embed a JavaFX application client in an EAR package and have it use dependency injection. But I found a solution which is quite intuitive and simple to reproduce. So to give you yet another example of a JavaFX application working as a remote GUI to the back end, please have a look at my tutorial:

http://blog.martinandersson.com/the-enterprise-side-of-javafx-the-missing-part/

2
  • I sought this blog, it is very helpful, But i cant find a way to test it with wildfly server. Because this one is missing this . config: <glassfish-application-client> <java-web-start-access> <jnlp-doc>META-INF/custom.jnlp</jnlp-doc> </java-web-start-access> </glassfish-application-client>
    – kamel2005
    Nov 20, 2015 at 15:56
  • wildfly doesn't have this file: glassfish-application-client.xml.
    – kamel2005
    Nov 20, 2015 at 15:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.