Previous Next vertical dots separating previous/next from contents/index/pdf

Step 1: Create an EAR Project and a Web Application Project

In this step you will create two projects: an EAR project and a Web Application project. These are the basic building blocks required for designing and testing a new Workshop for WebLogic web application.

An EAR project configures and stores resources for other components that belong to it, components such as web applications, EJBs, databases, etc. An EAR project has two main roles: (1) It is a composite project made up of other projects, such as web projects, EJB projects, and others. (2) Is it a resource project containing library modules and JARs which other projects utilize.

The web application project you create belongs to the EAR project.

The tasks in this step are:

To Start Workshop for WebLogic and Create a New Workspace

If you haven't started Workshop for WebLogic yet, use these steps to do so.

... on Microsoft Windows

If you are using a Windows operating system, follow these instructions.

...on Linux

If you are using a Linux operating system, follow these instructions.

(If you have already started Workshop for WebLogic, select File > Switch Workspace.)

  1. In the Workspace Launcher dialog, click the Browse button.
  2. In the Select Workspace Directory dialog, navigate to a directory of your choice and click Make New Folder.
  3. Name the new folder WebAppTutorial, press the Enter key and Click OK.
  4. In the Workspace Launcher dialog, click OK.

To Create a New Web Project and a New EAR Project

  1. From the File menu, select New > Project.
  2. In the New Project dialog, on the Select a wizard page, select the node Web> Dynamic Web Project.
    Click Next.
  3. In the Project Name field, enter CustomerCare
    Place a check mark next to Add project to an EAR.
    Confirm that the EAR Project Name is CustomerCareEAR.
  4. Click Finish.

When you web project is first created, it is displayed in the Package Explorer view by default. The Package Explorer view shows a logical view of your workspace and its JAR resources.

The image to the right shows your workspace in the Navigator view. To switch to the Navigator view select Window > Show View > Navigator. The Navigator view shows your workspace as it is saved on disk.

There are now two projects in your workspace: the web project CustomerCare and the EAR project CustomerCareEAR. The two projects appear as sibling projects, since they are on the same level of the directory tree. But when the projects are compiled and deployed, the EAR project CustomerCareEAR is really a container project for the web project customerCare.

The CustomerCare Web Project

The CustomerCareEAR EAR Project

To Import Files into Your Web Project

In this step you will import control files into your web project--control files that provide access to a customer database. An alternative design would locate these controls in a utility project (File > New > Project > J2EE > Utilty Project), which would make the controls available to all projects in the workspace. But for the sake of simplicity and expediency we have placed the controls directly in the web project.

  1. On the Navigator tab, open the CustomerCare folder.
  2. Open Windows Explorer (or your operating system's equivalent) and navigate to the directory BEA_HOME/workshop92/workshop4WP/eclipse/plugins/com.bea.wlw.samples_9.2.1/tutorials/resources/webApp/

    Watch Out!
    Don't open the webService folder!
  3. Drag the folders controls and model (located at BEA_HOME/workshop92/workshop4WP/eclipse/plugins/com.bea.wlw.samples_9.2.1/tutorials/resources/webApp/) into the Navigator tab directly onto the folder customerCare/src.
  4. Confirm that the following directory and file structure exists before proceeding.

To Add a WebLogic Server Domain

In this step you will point to a server where you can deploy your application.

Note: if you have executed this tutorial before your server may already contain previous deployments of the tutorial-related projects. Before proceeding, it is recommended that you either (1) remove previous tutorial code from your server or (2) create a new server domain.

  1. Confirm that you are in the Workshop perspective (Window > Show Perspective > Workshop).
  2. Click the Servers tab.

  3. Right-click anywhere within the Servers tab, and select New > Server.
  4. In the New Server dialog, select BEA Systems Inc.> BEA WebLogic v9.2 Server. Click Next.
  5. In the Domain home dropdown, select the location BEA_HOME/weblogic92/samples/domains/workshop. (Note: if you are using a newly created server domain for this tutorial, then use the Browse button to navigate to that server domain, for example, BEA_HOME/user_projects/domains/base_domain.)
    Click Next.
  6. In the Available projects column, select CustomerCareEAR. Click the Add button to move the select project to the Configured projects column.
  7. Click Finish.

    A new server is added to the Servers tab.

You can use the Servers tab to manage your servers and project deployments as you develop you applications.

To deploy or undeploy a project from a server, right-click the server and select Add and Remove Projects.

For a more properties, double-click a server.

Click one of the following arrows to navigate through the tutorial:

 

Skip navigation bar   Back to Top