Web Application Development: Configuring Projects with External Resources

If you have a project that uses external resources, for example Java classes and web resources such as JSP files, which are present outside of your workspace, or from other projects, you can configure the project so that WebLogic looks up these resources at runtime.

The features that you can use are:

1 Using a Dynamic Project

If your project is not an Eclipse WTP project you need wrap it with a dynamic web project in order to deploy it toOracle WebLogic Server. Once you have created the skeleton web project, you can use the linked resources technique (below) to link web resources to thecorresponding Web content or Java source folder in the dynamic Web project. This project may contain a number of optional facets, one of which is the Web Service facet. Each dynamic Web project ultimately produces a J2EE module, and each J2EE module is included in the complete application's EAR file when the application is built for deployment. The contents of Web projects are accessed through URLs.

For more information, see "Creating a dynamic Web project" which is available in the Web Tools Platform User Guide in the Eclipse documentation.

2 Using Linked Resources

Linked resources are files and folders stored in a different location but which can be linked to your project. You can link both Web content such as JSP files and HTML files, folders or or Java source folders into a web project using this method. For more information, see Linked resources which is available in the Workbench User Guide in the Eclipse documentation. For information about using linked resources, see Creating linked resources, in the Workbench User Guide in the Eclipse documentation.

3 Configuring a Deployment Assembly

The types of external resource you can configure using deployment assembly are:

  • Archives available via a path variable, or on the local file system, or in the current workspace.
  • Folders in the current workspace.
  • Java build path entries.
  • Projects in the current workspace.

You configure a project to use external resources as follows:

  • Right-click your Web project in Project Explorer, select Properties from the drop-down menu, and then select Deployment Assembly from the list on the Properties dialog.

    Figure 1 shows a web content folder from linked resources and an external JAR have been added to the deployment assembly.



    Figure 1.
    Specifying Web Deployment Assembly.


  • Click Add to open the New Assembly Directive dialog, where you specify the external resources to be configured with your project.



    Figure 2.
    New Assembly Directive Dialog


    Choose the type of external resource you want to add on this page and click Next. On the next page, navigate to the specific external resource you want and click Finish.