JavaFX and Spring CRUD

Exadel Flamingo RIA framework comes with CRUD application generator. Using the maven-based generator, you can easily generate JavaFX user interfaces connected to Spring or Seam back-ends. In this post I showed how to do it Seam. Let’s do the same with Spring framework. There are just a few simple steps.

  1. If you don’t have, download and install JavaFX SDK 1.2 for your operating system.
    1. Set JAVAFX_HOME variable
  2. Download Exadel Flamingo
  3. Unzip the downloaded file
  4. Run flamingoinstall (if you are on Linux, you will need to make the file executable)
  5. Inside flamingo/bin, run flamingo create project . Just follow the wizard questions, in most cases you can accept the default values. My answers are shown in bold.
    max@:~/Exadel/Flamingo/flamingo-1.8.2$ ./bin/flamingo create project
    [INFO] Scanning for projects...
    [INFO] ------------------------------------------------------------------------
    [INFO] Building Maven Default Project
    [INFO]    task-segment: [com.exadel.flamingo.maven.plugin:flamingoapp:1.8.2:create-project] (aggregator-style)
    [INFO] ------------------------------------------------------------------------
    [WARNING] While downloading jboss:javassist:3.3.ga
      This artifact has been relocated to javassist:javassist:3.3.GA.
    
    [INFO] [flamingoapp:create-project]
    discovered andromdapp type --> 'flamingo-seam'
    discovered andromdapp type --> 'flamingo-spring'
    Please choose the type of application to generate (flamingo-seam, flamingo-spring):[flamingo-spring]
    flamingo-spring
    Please enter the location in which your new application will be created (i.e. c:/java/development):
    [/home/max/Exadel/Flamingo/dev]
    /home/max/Exadel/Flamingo/dev
    Enter the project name (e.g. myproject): [javafx-spring]
    javafx-spring
    Please enter the root package name for your project (e.g. com.mydomain.myproject): [com.sample]
    com.sample
    Will this project have Flex or JavaFX user interface? (flex, javafx): [javafx]
    javafx
    What kind of database are you using? (hsql, mysql, oracle, postgres, mssql, db2, sybase, none): [hsql]
    hsql
    Enter the JDBC URL for your database (e.g. jdbc:hsqldb:.): [jdbc:hsqldb:.]
    jdbc:hsqldb:.
    Enter database username: [sa]
    sa
    Enter database password: []
    Do you want to update the database schema each time you deploy? (y, n): [y]
    y
    Enter the entity class name (Flex source files to view and modify entities will be generated as well): [Person]
    Person
    ....
    ....
    
  6. Once generation is completed, go to javafx-spring/web and run this command: ant -f build.xml create-keyEntry
  7. Go one level up to javafx-spring/web and run: mvn package
  8. Copy javafx-spring/web/target/javafx-spring.war to Tomcat
    8) Start Tomcat
  9. Go to http://localhost:8080/javafx-spring and start the JavaFX applet.

You will see an application shown below:

Login screen:
screenshot_002

Main screen (before entering users):
screenshot_003

Adding a user:
screenshot_004

Main screen with users:
screenshot_005

6 thoughts on “JavaFX and Spring CRUD

  1. Hi, I’m trying to configure spring javafx project with exadel Flamingo following this article but when I run mvn package on javafx-spring/ I get the error:

    [ERROR] BUILD ERROR
    [INFO] ————————————————————————
    [INFO] Error executing ant tasks

    Embedded error: The following error occurred while executing this line:
    /home/dmcom/Exadel/Flamingo/dev/javafx-spring/javafx/javafx-build.xml:30: /home/dmcom/Exadel/Flamingo/dev/javafx-spring/javafx/${JAVAFX_HOME} not found.

    I’m using Ubuntu 9.04 and I have javafx-sdk1.2 installed on /home/dmcom/javafx-sdk1.2/ as I can see running echo ${JAVAFX_HOME}

    Any Ideas of what could be happening?

    Thank’s

  2. Yes, finally I fixed it replacing in file javafx/javafx-build.xml “${JAVAFX_HOME}” with the absolute path of the JavaFx SDK “/home/user/javafx-sdk1.2”.

    Thank you.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s