Swapnil_Narvekar
Swapnil_Narvekar

Reputation: 89

How to integreate Java FX and Spring MVC


I want to use JavaFx as a front-end in my web-application. My question is that is it possible to bind Model object with the form which is developed with Java Fx.
I kindly request you to put some light on this issue.
Please let me know If you need more clarification regarding this

Upvotes: 6

Views: 5638

Answers (2)

ItachiUchiha
ItachiUchiha

Reputation: 36722

The main difference between JAVAFX and any Java EE framework is same as the difference between the swing applications and Java EE apps.

You can design applications using JAVAFX to be directly used on desktop or deployed as browser applets with the help of the Java browser plugin. But, using it as a framework for designing the front end of a Java EE application is not possible.

Read this post :

https://www.java.net//node/674176

Upvotes: 2

Puce
Puce

Reputation: 38132

The main differences between Web front-ends (like Spring MVC) and rich clients (and RIAs like JavaFX) is that for web front-ends the server-side logic runs in the same JVM as the web framework while for rich clients the server-side logic and the client are running on 2 separate JVMs, one on the server machine and one on the client machine.

Rich clients are usually downloaded/ installed completely before the user can run it, while for web front-ends each HTML page is possibly first dynamically created and then send to the user as needed.

Since the user usually already has the complete rich client from start, only the actual data (DTOs) get sent back and forth using some kind of remote service e.g Web Services.

So this means that the JavaFX client cannot access the objects of the server (e.g. attached JPA entities). You need to wrap the data up and send it to the JavaFX client using some kind of service (see the Service Facade and DTO design patterns).

Upvotes: 2

Related Questions