Deploying to a Faces JSP

You can deploy your J2C Java™ bean through a Faces JSP.
Once you have created your J2C application, you can create a Faces JSP and deploy it on WebSphere® Application Server.
Note: The option to create a Faces JSP 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 Version 6.1 and test environments for legacy application servers such as, WebSphere Application Server Version 6.0. WebSphere Application Server Version 5.1 is not supported.

The test environment that you use to run your web application depends on how the application is generated. For example, if you selected servlet version 2.4 (J2EE Version 1.4) when you defined the dynamic web project for your application, you must select WebSphere Application Server Version 6.1 as your target server and you must test your application using the WebSphere Application Server Version 6.1 Test Environment.

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

To create a Faces JSP to deploy your J2C Java bean, complete the following steps:

  1. Open the Web Page, Web Service, or EJB from J2C Java bean wizard
    • If you are creating a Faces JSP for a J2C Java bean that already exists in your workspace, follow these steps: .
      1. Select File > New > Other > J2C > Web Page, Web Service, or EJB from J2C Java bean.
      2. Click Next.
      3. On the J2C Java bean selection page, click Browse to locate your J2C Java bean. If you know the letter that the name of your J2C Java bean starts with, type that letter in the Select entries field, or type ? to see a list of all the J2C Java beans. Highlight your selection and click OK.
      4. Click Next.
    • If you have followed the J2C Java bean wizard to the end, then on the Deployment Information page, select Create J2EE resource.
  2. In the Deployment Information page, select Create J2EE resource.
  3. In the J2EE Resource Type, select Faces JSP.
  4. Click Next.
  5. 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.
  6. In the Faces file name field, provide a name for the Faces JSP file.
  7. Click Show 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 will confirm 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 project name.
  8. If you selected Configure Resource Adapter Deployment on the Deployment Information page, click Next to go specify the RAR settings. page. This option is only available when the connection to the EIS is not purely managed. If the connection is managed, the RAR deployment to the server is implied.
  9. If you did not select Configure Resource Adapter Deployment on the Deployment Information page, click Finish.
  10. Once you have created the Faces JSP file, the page should open the new Faces JSP in the Design page of Page Designer. If it is not in the Design page, expand the folder where your Faces JSP is saved. Right click on the new Faces JSP, click Open With, and click on Page Designer. The Faces JSP will open in the Design page of the editor.
  11. The Palette view should appear on the right panel. If it does not appear, in the top menu, click on Window > Show view > Palette.
  12. You then can drag and drop selected controls from the Faces Component from the Palette into your Faces page. You can also drag and drop one of the Java methods that you created from the Page Data view, and specify input and output data that you want to display.
  13. Save your Faces JSP by pressing Ctrl-S or by clicking File > Save in the toolbar.
  14. To test the Faces JSP 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 v6.1, and select Start.
  15. In the Project Explorer view, right-click the Faces JSP that you just created
  16. Select Run > Run on Server.
  17. Select WebSphere Application Server v6.1 and click Finish.
  18. A Web browser will open to your Faces JSP page, and you can input data to test the application.
Related concepts
Resource adapter deployment

Feedback