Deploying to a Faces web page

You can deploy your J2C bean through a Faces web page.

Before you begin

After you have created your J2C application, you can create a Faces web page and deploy it on WebSphere® Application Server.
Note: The option to create a Faces web page is available if you have installed the optional Faces support feature when you installed the product.

You can test your application using one of the test environments included in the development platform. For example, you can include test environment for WebSphere Application Server V7.0, V8.0, or V8.5. Test environments for legacy application servers such as WebSphere Application Server Versions 6.1, 6.0. and 5.1 are not supported.

If the Web icon, Web perspective icon, does not appear in the top right tab of the workspace, you need to Switch to the Web perspective

Procedure

  1. Select File > New > Other > J2C > Web Page, Web Service, or EJB from J2C bean to open the wizard
    • If you are creating a Faces web page for a J2C bean that exists in your workspace:
      1. Select File > New > Other > J2C > Web Page, Web Service, or EJB from J2C bean and click Next.
      2. On the J2C bean selection page, click Browse to locate your J2C bean. If you know the letter that the name of your J2C bean starts with, type that letter in the Select entries field, or type ? to see a list of all the J2C beans. Highlight your selection and click OK.
      3. Click Next.
    • If you have followed the J2C bean wizard to the end, then on the Deployment Information page, select Create a Web page, Web Service, or EJB from the J2C bean resource.
  2. In the Deployment Information page, select Create Java EE resource.
  3. In the Java EE Resource Type, select Faces JSP, and click Next.
  4. In the JSP folder field, click Browse to select an existing JSP folder, or enter a name (for example, SampleJSP) in the JSP folder name field.
  5. In the Faces file name field, provide a name for the Faces web page file.
  6. Click Advanced if you want to set advanced properties.
    1. In the Resource Reference field, provide a resource reference name. This resource reference maps the name used in the application to the actual JNDI resource name specified on the runtime server. Creating a resource Reference is the preferred method of managing connections, because it makes your application code less server dependent. That is, if you want to use a different server on which to run your application, you can create a new resource reference that binds to the new server without needing to change your application source code. Once you provide a resource reference name, the wizard confirms that the JNDI name exists in the server.
    2. In the JNDI lookup name field, ensure that the correct name of your JNDI lookup appears. If it does not appear, or is not correct, type the correct JNDI lookup name.
  7. If you selected Configure Resource Adapter Deployment on the Deployment Information page, click Next to go to the specify the RAR settings page. This option is only available when the connection to the EIS is not managed. If the connection is managed, the RAR deployment to the server is implied.
  8. If you did not select Configure Resource Adapter Deployment on the Deployment Information page, click Finish.
  9. Once you have created the Faces web page file, the page opens the new Faces web page in the Design page of Page Designer. If it is not in the Design page, expand the folder where your Faces web page is saved. Right click the new Faces web page, click Open With, and click Page Designer. The Faces web page opens in the Design page of the editor.
  10. The Palette view appears on the right panel. If it does not appear, in the top menu, click Window > Show view > Palette.
  11. You then can drag selected controls from the Faces Component of the Palette into your Faces page. You can also drag one of the Java™ methods that you created from the Page Data view, and specify input and output data that you want to display.
  12. Save your Faces web page by pressing CTRL+S or by clicking File > Save in the toolbar.
  13. To test the Faces web page on a server, select the Servers tab to open the Servers view. Start the server, if it is not already running. To start the server, right click WebSphere Application Server V7.0 or V8.0 and select Start.
    Restriction: J2C applications are supported to run only on the WebSphere Application Server.
  14. In the Enterprise Explorer view, right-click the Faces web page that you created
  15. Select Run > Run on Server.
  16. Select WebSphere Application Server v7 and click Finish.
  17. A Web browser opens to your Faces web page, and you can input data to test the application.

Feedback