FeaturesPluginsDocs & SupportCommunityPartners

Installing the Currency Trader Sample Application

This document describes how to download, install, deploy, and run the Currency Trader sample application. The sample application demonstrates how to use Dynamic Faces technology to employ Ajax techniques with Ajax-unaware JavaServer Faces components. The application uses both the Ajax Zone and Ajax Transaction components that come with the Dynamic Faces component library. The application comprises one rendered page, shown below, and is entirely Ajax-based. No conventional page submissions occur.

Contents

Content on this page applies to NetBeans IDE 6.0

To follow this tutorial, you need the following software and resources.

Software or Resource Version Required
NetBeans IDE Web & Java EE version 6.1
or 6.0
Java Developer Kit (JDK) Version 6 or
version 5
JavaServer Faces Components/
Java EE Platform
1.1 with J2EE 1.4
Travel Database Not required
GlassFish Application Server V2

Tutorial Requirements


Before you begin, you need to install the following software on your computer:

  • NetBeans IDE 6.1 or with the Web and Java EE pack (included in the Web and Java EE download and the All download). (download)
  • Project Dynamic Faces Ajax Components and Samples plugin

    Note: If you are using NetBeans 6.0, the plugin is called Visual Web JSF Post Release Samples

  • Visual Web JSF Backwards Compatibility Kit

Obtaining the Sample Application

To obtain the Currency Trader sample application, you must install the Visual Web JSF Samples plugin. See the instructions in Installing the Project Dynamic Faces Ajax Components and Samples Plugin. During the steps on installing the plugin using the Plugins Manager, be sure to select the entries for both the Project Dynamic Faces Ajax Components and Samples plugin and the Visual Web JSF Backwards Compatibility Kit.

Note: If you are using NetBeans 6.0, the plugin is called Visual Web JSF Post Release Samples

Creating the Currency Trader Web Application

You are now ready to create the Currency Trader web application.

Currency Trader Sample Application
  1. From the main menu, choose File > New Project.
  2. In the New Project wizard, select Samples > Web > Visual JSF from the Categories list and Currency Trader from the Projects list, as shown below.
  3. Click Next.

    Currency Trader Visual Web JSF Project
  4. Specify a project location.

  5. Click Finish to create the project.

    Note: In the Projects window, the Currency Trader node displays with a red icon, indicating errors in the project. This is because there are dependencies on the Dynamic Faces component library, which needs to be added to the project.

  6. In the Projects window, right-click Component Libraries and choose Add Component Library from the popup menu.

    Add Component Library
  7. Select Dynamic Faces Components (0.2) and click Add Component Library.

    The Currency Trader node no longer displays with a red icon, indicating the errors have been resolved.
  8. Right-click the Currency Trader node and choose Build from the popup menu.
  9. Expand the Web Pages node and double-click Page1.jsp to open the page in the Visual Designer.
  10. Click Show Virtual Forms in the Visual Designer toolbar to view the Ajax Transaction configuration for the page. The page uses one Ajax Transaction called pollTx that performs the work of polling the server for the latest exchange rate information.
  11. You must view the web application from either Internet Explorer 7 or Firefox 1.5 or higher. Follow these steps to ensure that the IDE opens the web application in one of these browsers.
    1. Choose Tools > Options from the main menu.
    2. In the General Tab of the Options window, choose Firefox or Internet Explorer, whichever is applicable.
    3. Click OK.
  12. In the main toolbar, choose Run > Run Main Project to run the web application.
  13. In the browser, open the Help page in a new browser tab or window to learn about the sample application.

Troubleshooting

If an error occurs that prevents the page from displaying correctly in the Visual Designer, follow these steps to resolve the problem.

  1. Be sure you have installed both the Project Dynamic Faces Ajax Components and Samples plugin and Visual Web JSF Backwards Compatibility Kit as described in Installing the Project Dynamic Faces Ajax Components and Samples Plugin.

    Note: If you are using NetBeans 6.0, the plugin is called Visual Web JSF Post Release Samples

  2. In the Projects window, expand the Component Libraries node. If you do not see the Dynamic Faces Components (0.2) node, add the Dynamic Faces component library as described in the previous section.
  3. Right-click the Currency Trader node and choose Build from the popup menu.
  4. Close and reopen the project.
  5. If the Currency Trader project node is not bold, right-click the Currency Trader project node and choose Set as Main Project.
  6. In the Projects window, expand the Web Pages node and double-click Page1.jsp to open the page if it is not already open. The page should now display correctly in the Visual Designer.

See Also



Bookmark this page

del.icio.us furl simpy slashdot technorati digg
Companion
Projects:
MySQL Database Server   Open JDK: an Open SourceJDK   GlassFish Community: an Open Source Application Server    Mobile & Embedded Community    Open Solaris   java.net - The Source for Java Technology Collaboration   Open ESB - The Open Enterprise Service Bus Powered by