Skip Headers
Oracle® Containers for J2EE Deployment Guide
10g Release 3 (10.1.3)
Part No. B14431-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

13 Deploying Web Applications from Eclipse

This chapter explains how to deploy a Web application to a standalone OC4J server directly from Eclipse using the Web Tools Platform, a set of Eclipse plug-ins provided under the aegis of the Eclipse Foundation.

The Eclipse Web Tools Platform project extends the Eclipse platform with tools for developing J2EE Web applications.

Installing the Web Tools Platform

Note that these instructions assume that you have already installed and configured a standalone OC4J instance. It also assumes that you have already installed Eclipse 3.1 for Windows.

Download and install each of the following files into the <eclipse_home>/eclipse/plugin directory. You can download all of these required components from the following Eclipse site:

http://download.eclipse.org/webtools/downloads/

Deploying a Web Application with the Web Tools Platform

This section provides an overview of how to create and deploy a Web application to OC4J using the Eclipse Web Tools Platform.

Connecting to OC4J from Eclipse

This section shows you how to connect to a standalone OC4J instance from Eclipse.

  1. Launch Eclipse.

  2. Open the J2EE perspective and select Window > Open Perspective > Other menu. Choose J2EE in the resulting dialog. This perspective includes the Servers view, which is used in the example deployment.

  3. Select Window > Show View > Console menu. This enables you to see the server output.

  4. Right-click in the Servers View and select New > Server menu. This launches the New Server wizard.

  5. In the Define a New Server panel, Select Oracle > Generic Oracle OC4J Standalone Server 10.1.3. Click Next.

  6. Set the following in the Define a New Generic Oracle OC4J Standalone 10.1.3 Runtime panel:

    • For JRE, select the JDK you are using.

    • For Oracle J2EE Home, browse to the \j2ee\home subdirectory in the folder where you installed the Oracle Application Server.

    • Click Next.

  7. Set the password to the password for the oc4jadmin administrator account you created during the OC4J installation in the Create a new Generic Oracle OC4J Standalone 10.1.3 server panel. Accept the defaults for all the other fields.

  8. Click Finish.

Building a Web Application

Next, create a simple Web application to deploy to the OC4J server instance.

  1. From the ProjectExplorer view, right-click on the Dynamic Web Projects folder and select New Dynamic Web Project.

  2. Enter a name for the project.

  3. Click the Show Advanced button. Note that the Target runtime field is pre-populated with the entry for OC4J: Generic Oracle OC4J Standalone 10.1.3.

  4. Accept the default values for all the fields in this dialog and click Finish.

  5. Now you will create a JSP page within your new project. Open the Dynamic Web Projects folder.

  6. Expand the project you created and then the WebContent folder.

  7. Right-click on the WebContent folder and select the New JSP menu.

  8. Enter a name for the file, such as index.jsp, and click Finish.

  9. The file is opened in a JSP Editor. Enter this text between the <BODY> tags:

    <% out.print("Hello World!!"); %>

  10. Save the file.

Deploying a Web Application

Once the Web application is ready, it can be deployed to OC4J directly from Eclipse.

  1. Right-click on the jsp file, index.jsp, in the ProjectExplorer. Select Run As > Run on Server menu.

  2. In the Run On Server dialog, verify that the server Oracle OC4J Standalone Server v10.1.3 is selected.

  3. Click Finish. The Eclipse WTP tool will now do the following:

    • Package the Web application.

    • Start the OC4J server if it is not running.

    • Publish the application to the OC4J instance.

    • Launch the application in a browser.

      The console view displays the log tracking the progress of the deployment.