Oracle® Containers for J2EE Deployment Guide
10g Release 3 (10.1.3) Part No. B14431-01 |
|
![]() Previous |
![]() Next |
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.
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/
Eclipse Modeling Framework (EMF), emf-sdo-xsd-SDK-2.1.0.zip
Graphical Editing Framework (GEF), GEF-SDK-3.1.zip
Java EMF Model Runtime (JEM), JEM-SDK-1.1.zip
Java EMF Model Runtime (JEM), JEM-SDK-1.1.zip
Eclipse Web Tools Platform Project (WTP), wtp-1.0M8.zip
This section provides an overview of how to create and deploy a Web application to OC4J using the Eclipse Web Tools Platform.
This section shows you how to connect to a standalone OC4J instance from Eclipse.
Launch Eclipse.
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.
Select Window > Show View > Console menu. This enables you to see the server output.
Right-click in the Servers View and select New > Server menu. This launches the New Server wizard.
In the Define a New Server panel, Select Oracle > Generic Oracle OC4J Standalone Server 10.1.3. Click Next.
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.
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.
Click Finish.
Next, create a simple Web application to deploy to the OC4J server instance.
From the ProjectExplorer view, right-click on the Dynamic Web Projects folder and select New Dynamic Web Project.
Enter a name for the project.
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.
Accept the default values for all the fields in this dialog and click Finish.
Now you will create a JSP page within your new project. Open the Dynamic Web Projects folder.
Expand the project you created and then the WebContent folder.
Right-click on the WebContent folder and select the New JSP menu.
Enter a name for the file, such as index.jsp, and click Finish.
The file is opened in a JSP Editor. Enter this text between the <BODY> tags:
<% out.print("Hello World!!"); %>
Save the file.
Once the Web application is ready, it can be deployed to OC4J directly from Eclipse.
Right-click on the jsp file, index.jsp, in the ProjectExplorer. Select Run As > Run on Server menu.
In the Run On Server dialog, verify that the server Oracle OC4J Standalone Server v10.1.3 is selected.
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.