Sun GlassFish Enterprise Server v3 Scripting Framework Guide

ProcedureTo Deploy and Run the Database-Backed Web Application

Creating database-backed web applications was described in To Create a Database-Backed Rails Application. The following task describes running the created books application on the GlassFish v3 Gem. You can alternatively deploy it to your regular Enterprise Server using directory-based deployment, as described in To Deploy the Rails Application as a Directory.

  1. Change to /books directory.

  2. Deploy the application to the GlassFish v3 Gem by running the following command:

    jruby -S glassfish books
  3. Run the application in your web browser using the following URL:

    http://localhost:3000/books

    The opening page says “Listing books” and has an empty table, meaning that there are no book records in the database yet. To add book records to the table, do the next step.

  4. Add records to the table by clicking the New book link on the index.html page.

  5. Enter the data for book on the new.html page and click Create.