sun.com docs.sun.com My Sun Worldwide Sites

  Previous Contents Next

The simplejMaki Example

This chapter uses the simplejMaki example, located in the tutorial bundle at swdp.tutorial.home/examples/jMaki, to demonstrate how to use Project jMaki to build interactive web applications. This example demonstrates the following jMaki features:

  • Using a Dojo Fisheye widget to navigate between pages.

  • Using JSON APIs to load data into widgets.

  • Responding to widget events using the publish and subscribe mechanism.

  • Connecting to external services using the XmlHttpProxy client.

  • Using jMaki widgets as JSP tags.

Building and Running the simplejMaki Application

This section tells you how to configure your environment and build and run the simplejMaki Application.

Configuring Your Environment

Before running the simplejMaki example, you must do the following, as described in the Preface:

  1. Install the Sun Web Developer Pack
  2. Configure the Sun Web Developer Pack with Application Server 9.1
  3. Optionally install NetBeans IDE 5.5.1 and the Sun Web Developer Pack modules

Building and Running the simplejMaki Application in NetBeans IDE 5.5.1

  1. Select File→Open Project in NetBeans IDE 5.5.1.
  2. Navigate to swdp.tutorial.home/examples/jmaki, select simplejMaki, and click Open Project Folder.
  3. Right-click the simplejMaki application in the Projects pane and select Run Project.

    This will compile the classes, package the files into a WAR file, deploy the WAR to your Application Server 9.1 instance, and open a web browser to the following URL:

    http://server:server-port/simplejMaki/

    From this page, you can use the fisheye widget to navigate to other pages and play around with the widgets. The other pages include:

    • A simple combobox widget that gets data from a bean and displays a message when you select a value from the widget.

    • A combobox interacting with a map widget. Selecting a state from the combobox plots its capital on the map.

    • A table widget that gets its data from a bean.

Building and Running the simplejMaki Application with Ant

  1. Open a terminal prompt and navigate to swdp.tutorial.home/examples/jmaki/simplejMaki.
  2. Type ant and press Enter.

    This will build and package the simplejmaki.war web application.

  3. Type ant deploy and press Enter.

    This will deploy simplejMaki.war to Application Server 9.1.

  4. In a web browser navigate to:
    http://server:server-port/simplejMaki/

    From this page, you can use the fisheye widget to navigate to other pages and play around with the widgets. The other pages include:

    • A simple combobox widget that gets data from a bean and displays a message when you select a value from the widget.

    • A combobox interacting with a map widget. Selecting a state from the combobox plots its capital on the map.

    • A table widget that gets its data from a bean.

  5. To undeploy the application, navigate to swdp.tutorial.home/examples/jmaki/simplejMaki and run ant undeploy.
  6. To delete the built application, navigate to swdp.tutorial.home/examples/jmaki/simplejMaki and run ant clean.
Previous Contents Next
Company Info Contact Terms of Use Privacy Copyright 1994-2007 Sun Microsystems, Inc.