Installing the Currency Trader Sample Application
Contributed by Chris Kutler, Matt Bohm, and James Branam
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
To follow this tutorial, you need the following software and resources.
| 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:
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.
- From the main menu, choose File > New Project.
- In the New Project wizard, select Samples > Web > Visual JSF from the Categories list and Currency Trader from the Projects list, as shown below.
Click Next.
Specify a project location.
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.
In the Projects window, right-click Component Libraries and choose Add Component Library from the popup menu.
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.
- Right-click the Currency Trader node and choose Build from the popup menu.
- Expand the Web Pages node and double-click Page1.jsp to open the page in the Visual Designer.
- 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.
- 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.
- Choose Tools > Options from the main menu.
- In the General Tab of the Options window, choose Firefox or Internet Explorer, whichever is applicable.
- Click OK.
- In the main toolbar, choose Run > Run Main Project to run the web application.
- 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.
- 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
- 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.
- Right-click the Currency Trader node and choose Build from the popup menu.
- Close and reopen the project.
- If the Currency Trader project node is not bold, right-click the Currency Trader project node and choose Set as Main Project.
- 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