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 of other components that are part of 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) It is 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.
  5. Close the Welcome view.

    img

To Create a New Web Project and a New EAR Project

  1. Right-click anywhere within the Project Explorer view and select New > Dynamic Web Project.
    Click Next.
  2. 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.
  3. Click Finish.

When your web project is first created, it is displayed in the Project Explorer view by default. The Project Explorer view shows a logical view of your workspace and its 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 EAR. But for the sake of simplicity and expediency we have placed the controls directly in the web project.

  1. On the Project Explorer view, open the nodes CustomerCare > Java Resources.

  2. Open Windows Explorer (or your operating system's equivalent) and navigate to the directory BEA_HOME/workshop_10.0/ workshop4WP/eclipse/plugins/com.bea.workshop.product.wl.samples_1.0.0/tutorials/resources/webApp/ and locate the controls and model folder.

    Watch Out! Don't open the webService folder by mistake!

  3. Drag the folders controls and model into the Project Explorer tab and drop them directly onto the folder customerCare/Java Resources/src.
  4. Before proceeding, confirm that the following directory and file structure exists.

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 J2EE perspective (Window > Show Perspective > J2EE ).
  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 > BEA WebLogic v10.0 Server. Click Next.
  5. In the Domain home dropdown, select the location BEA_HOME/wlserver_10.0/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 your applications.

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

For more properties, double-click a server.

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

 

Skip navigation bar   Back to Top