Import to and export from the workbench

The File menu allows you to import and export Workbench resources. Also you can use context menu.

Import. Export.

The File > Import ... option launches the import wizard, which allows you to add resources to the Workbench.

The File > Export ... option launches the export wizard, which allows you to export resources from the Workbench.

Import Wizard

This wizard helps you import resources into the Workbench. When the Import Wizard first comes up, you must choose what type of import to do:

Import Wizard

Existing Project

Imports a project into this workspace that was previously located in this workspace, or that currently exists in another workspace.

Import Existing Project

File System

If you choose this option, you will import files from the file system.

Import File System

Zip File

If you choose this option, you will import files from an archive (*.zip, *.jar) file.

Import Zip File

Importing Web archive (WAR) file

A Web archive (WAR) file is a portable, packaged Web application. In some cases, you may wish to work with existing workbench Web projects that exist in other locations. It may be advisable to determine whether the WAR file that you are importing contains Java source files if you have a use for them.

Note: When importing a WAR file into an existing Web project, the imported Web deployment descriptor files are either not changed or overwritten by the ones included the imported WAR file, based on your response to the prompt that is provided. In either case, this action does not represent a merging of the two sets of deployment descriptors.

To work with these Web project resources, you can import them into your own development environment, as follows:

  1. Create the project that you wish to import Web resources into using the Create a Web Project wizard.

  2. Select File > Import.

  3. In the Import dialog, either double click on WAR file or select WAR file and click Next.

  4. Locate the WAR file that you want to import using the Browse button.

    Import WAR File

  5. Specify a new or existing Web project that you want to import the WAR into. If it is a new project, you will need to supply a name and location for the project.

  6. Specify a context root for the Web project if it differs from the default. The context root is the Web application root, the top-level directory of your application when it is deployed to a Web server. You can change the context root after you create a project using the project Properties dialog, which you access from the project's context menu. The context root can also be used by the links builder to ensure that your links remain ready to publish as you move and rename files inside your project.

  7. Specify the name of a new or existing Enterprise Application (EAR) project that the new Web project should be imported into for purposes of deployment. Any folders and files in the specified New project location, as well as associated subfolders and contents, will be included in the project. If you select the Existing radio button, the you can accept the default, or use the Browse button to locate another existing Enterprise Application project. If you select the New radio button, you can either accept the default Enterprise Application project location, or use the Browse button to define another location.

    Note: If you want to add a Web project as a module to another Enterprise Application project in the future, you can open the application.xml editor for the Enterprise Application project and select the Add option in the General page.

  8. Optionally, supply WAR import Options, such as whether to overwrite any existing project resources during the import process.

  9. Click Finish to populate the Web project.

Export Wizard

This wizard help you export resources from the Workbench.

When the Export Wizard first comes up, you must choose what type of export to do:

Export Wizard

File System

If you choose this option, you will export files to the file system.

Export File System

JAR File

If you choose this option, you will export files to an JAR file.

Export JAR File

You can make JAR file executable (java -jar XXXXXXX.jar).

Export JAR File. Selecting the Main file

Zip File

If you choose this option, you will export files to an archive (zip) file.

Export Zip File

Exporting Web Archive (WAR) file

A Web archive (WAR) file is a packaged Web application that can be exported to test, publish, and deploy the resources developed within a Web project.

To export WAR file from a Web project, do the following:

  1. From the context menu of a Web project folder, select Export .... You can alternatively select File -> Export, then WAR File, and click Next.

  2. Specify the Web project you wish to export (this field is primed if you used the context menu to launch the wizard), and specify a location for the new WAR file.

  3. Optionally, supply WAR export Options, such as whether or not to include Java source files in the WAR, and whether to overwrite any existing resources during the export process.

    Export WAR File

    Note: Source files are not usually included in a WAR file, because they are not necessary for the server to run the web application.

  4. Click Finish.

Professional hosting     Belorussian informational portal         Free SCWCD 1.4 Study Guide     Free SCBCD 1.3 Study Guide     Free SCDJWS 1.4 Study Guide     SCDJWS 1.4 Quiz     IBM Test 000-287. Enterprise Application Development with IBM WebSphere Studio, V5.0 Study Guide     Free Mock Exam Engine