Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

This sample shows you how to do a full CRUD application with Spiffy UI. A simple user form show lists of users and user details while communicating with a simple REST server.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 src
Octocat-spinner-32 .classpath
Octocat-spinner-32 .project
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 README.md
Octocat-spinner-32 SpiffyForms_devmode.launch
Octocat-spinner-32 pom.xml
Octocat-spinner-32 screenshot.png
README.md

Spiffy UI - GWT made simple

This sample shows you how to create, read, update, and delete with Spiffy UI forms. It includes a simple REST server running on Java with Jersey.

Everything starts with a REST bean named User.java. This bean handles the CRUD operations of our application. The UI is handled in Index.java.

This application shows you how to make the full range of REST requests and build complex form layouts with Spiffy UI. All data is stored in memory on the server so there's no additional setup. Just build it and run it and you'll get an application that looks like this:

Building and Running SpiffyForms

This project is built with Apache Maven.

Go to your project's root directory and run the following command:

mvn package jetty:run

This will download the required libraries, build your project, and run it. You can access the running application here:

http://localhost:8080

Debugging through Eclipse

See Spiffy UI's GWT Dev Mode page for more information.

The REST API

This application exposes a simple REST API for editing users:

GET /api/users - Get a list of users including user details.

[
    {
        "birthday": "-11995200000",
        "lastName": "Addams",
        "userID": "aadams",
        "desc": "Alice Addams is just some girl",
        "email": "aadams@amazon.com",
        "gender": "female",
        "firstName": "Alice",
        "password": "aaa"
    },
    {
        "birthday": "269582400000",
        "lastName": "Brown",
        "userID": "bbrown",
        "desc": "Bob Brown is just some guy",
        "email": "bbrown@bn.com",
        "gender": "male",
        "firstName": "Bob",
        "password": "b0bpass"
    }
]

*GET /api/users/ - Get the data about the specified user.

{
    "birthday": "-11995200000",
    "lastName": "Addams",
    "userID": "aadams",
    "desc": "Alice Addams is just some girl",
    "email": "aadams@amazon.com",
    "gender": "female",
    "firstName": "Alice",
    "password": "aaa"
}

Returns a 404 if the specified user ID doesn't exist

*POST /api/users/ - Add the specified user.

Input:

{
    "birthday": "-11995200000",
    "lastName": "Addams",
    "userID": "aadams",
    "desc": "Alice Addams is just some girl",
    "email": "aadams@amazon.com",
    "gender": "female",
    "firstName": "Alice",
    "password": "aaa"
}

Output:

{"success": true}

*PUT /api/users/ - Update information about the specified user.

Input:

{
    "birthday": "-11995200000",
    "lastName": "Addams",
    "userID": "aadams",
    "desc": "Alice Addams is just some girl",
    "email": "aadams@amazon.com",
    "gender": "female",
    "firstName": "Alice",
    "password": "aaa"
}

Output:

{"success": true}

*DELETE /api/users/ - Delete the specified user from the system

Output:

{"success": true}

Returns a 404 if the specified user ID doesn't exist

License

Spiffy UI is available under the Apache License, Version 2.0.

Something went wrong with that request. Please try again.