Deploying to a JSP

You can deploy the J2C application to a JSP.

Once you have created your J2C application, you can create a JSP and deploy it on WebSphere® Application Server.

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.0 and test environments for legacy application servers such as, WebSphere Application Server Version 5.1 and WebSphere Application Server Version 5.0.

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.0 as your target server and you must test your application using the WebSphere Application Server Version 6.0 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 JSP to deploy your J2C Java™ bean, complete the following steps:

  1. In the Deployment Information page, select Create J2EE resource.
  2. In the J2EE Resource Type, select JSP.
  3. Click Next.
  4. In the JSP Creation page, select Generate simple JSPs with default input modes.
  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 EAR Project field, type the name of your EAR, or use the drop down list to locate the EAR associated with this project.
  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.
  9. If you did not select Configure Resource Adapter Deployment on the Deployment Information page, click Finish.
    Note: If an warning window appears, click OK; you are still able to deploy your JSP to the server.
    JSP warning dialog
  10. Select WebSphere Application Server V6 Server. Click Next. NOTE: If you do not see the WebSphere Application Server V6 Server, go to the View by field, and select name.
  11. Accept the default port number; if it is already in use, modify the port settings.
  12. Click Next.
  13. Select your project's EAR file from Available projects list. Click Add.
  14. Click Finish.
  15. To test the 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 the server, and select Start.
  16. When the server is successfully started, right click on your JSP project in the Project Explorer view, and select Run > Run on Server.
  17. Select WebSphere Application Server 6.0 and click Finish. The JSP opens in a browser.
Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.