Monday Mar 29, 2010

JavaFX + JSP


There were many queries related to integration of JavaFX with JSP or JSF. JavaFX is executed on client side, JSP & JSF resides on server, so "integration" in this context can be an overloaded term. Lets try one approach..

Its easy to just copy-paste all of those JavaFX launch script into your JSP. Another approach is to write a Custom Tag Library which will generate and embed the necessary code. JSP pages will use this tag library. This will allow to consolidate all JavaFX related code, customize the generation of JavaFX tags, pass additional arguments which are specific to your application.

A simple tld is shown here - javafx.tld - It accepts all parameters that are required to construct JavaFX applet tag as argument. You can pass additional arguments (in this case it passes User-Agent header information) to JavaFX Applet. The tag library is implemented by - JavaFXTag.java. It can be used as any other tag library as shown in - index.jsp. Rest of JavaFX - Server communication can be handled directly in JavaFX layer using AJAX like approach - REST WebServices - or directly invoking server technologies using JavaEE APIs

Its just a start, but I think it helps to consolidate and customize the "integration"..

About


The views expressed on this blog are my own and do not necessarily reflect that of my organization

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today